OpendTect-6_4  6.4
visnormals.h
Go to the documentation of this file.
1 #ifndef visnormals_h
2 #define visnormals_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Kristofer Tingdahl
9  Date: 4-11-2002
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 
17 #include "visbasemod.h"
18 #include "visdata.h"
19 #include "positionlist.h"
20 #include "viscoord.h"
21 
22 namespace Threads { class Mutex; };
23 
24 
25 namespace visBase
26 {
27 
33 {
34 public:
35  static Normals* create()
37 
38  void inverse();
40  int nrNormals() const;
42  void setNormal(int,const Coord3&);
43  int addNormal(const Coord3&);
44  int nextID(int previd) const;
45  void removeNormal( int );
46  Coord3 getNormal(int) const;
47  void addNormalValue(int,const Coord3&);
48  void clear();
49 
50  void setAll(const float* vals,int nmsz);
52 
53  void setAll(const Coord3* coords,int nmsz);
55 
56  void setAll(const Coord3& coord,int nmsz);
58 
59  void setDisplayTransformation(const mVisTrans* nt);
60  const mVisTrans* getDisplayTransformation() const
61  { return transformation_; }
62 
63  osg::Array* osgArray() { return osgnormals_; }
64  const osg::Array* osgArray() const { return osgnormals_; }
65 
66 protected:
67  ~Normals();
72 
74 
75  osg::Array* osgnormals_;
76  friend class DoTransformation;
77 
78 };
79 
81 {
82 public:
84  : normals_( n )
85  { normals_.ref(); }
86 
87  int nextID(int previd) const{ return normals_.nextID(previd); }
88 
89  int add(const Coord3& n ) { return normals_.addNormal(n); }
90  void set(int idx,const Coord3& n) { normals_.setNormal(idx,n); }
91  void remove(int idx) { normals_.removeNormal(idx); }
92  Coord3 get(int idx) const { return normals_.getNormal(idx); }
93  void addValue(int idx, const Coord3& n)
94  { normals_.addNormalValue(idx,n ); }
95  bool isDefined(int idx) const
96  { return normals_.getNormal(idx).isDefined(); }
97  void remove(const TypeSet<int>&);
98  int size() const { return normals_.nrNormals(); }
99 
100  Normals* getNormals() { return &normals_; }
101 
102 protected:
103  ~NormalListAdapter() { normals_.unRef(); }
104 
106 };
107 
108 };
109 
110 #endif
void addValue(int idx, const Coord3 &n)
Adds value to existing value at id.
Definition: visnormals.h:93
#define mExpClass(module)
Definition: commondefs.h:160
bool isDefined(int idx) const
Definition: visnormals.h:95
Interface for a list of Coord3 with automatically maintained IDs.
Definition: positionlist.h:72
int size() const
Definition: visnormals.h:98
DataObject is the base class off all objects that are used in Visualization and ought to be shared in...
Definition: visdata.h:65
void clear(std::ios &)
const visBase::Transformation * transformation_
Definition: visnormals.h:73
interface to threads that should be portable.
Definition: atomic.h:28
~NormalListAdapter()
Definition: visnormals.h:103
osg::Array * osgnormals_
Definition: visnormals.h:75
Definition: visnormals.h:32
osg::Array * osgArray()
Definition: visnormals.h:63
#define mVisTrans
Definition: visdata.h:31
Normals & normals_
Definition: visnormals.h:105
static Normals * create()
Definition: visnormals.h:35
NormalListAdapter(Normals &n)
Definition: visnormals.h:83
Definition: visnormals.h:80
A cartesian coordinate in 3D space.
Definition: coord.h:72
int add(const Coord3 &n)
Return new id, or -1 if unsuccessful.
Definition: visnormals.h:89
Definition: visannot.h:43
TypeSet< int > unusednormals_
Definition: visnormals.h:70
const osg::Array * osgArray() const
Definition: visnormals.h:64
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
Threads::Mutex & mutex_
Definition: visnormals.h:71
#define mCreateDataObj(clss)
Definition: visdata.h:209
Normals * getNormals()
Definition: visnormals.h:100
int nextID(int previd) const
Definition: visnormals.h:87

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