OpendTect  6.3
visnormals.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: 4-11-2002
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 
15 #include "visdata.h"
16 #include "viscoord.h"
17 #include "positionlist.h"
18 
19 namespace Threads { class Mutex; };
20 
21 
22 namespace visBase
23 {
24 
30 {
31 public:
32  static Normals* create()
34 
35  void inverse();
37  int nrNormals() const;
39  void setNormal(int,const Coord3&);
40  int addNormal(const Coord3&);
41  int nextID(int previd) const;
42  void removeNormal( int );
43  Coord3 getNormal(int) const;
44  void addNormalValue(int,const Coord3&);
45  void clear();
46 
47  void setAll(const float* vals,int nmsz);
49 
50  void setAll(const Coord3* coords,int nmsz);
52 
53  void setAll(const Coord3& coord,int nmsz);
55 
56  void setDisplayTransformation(const mVisTrans* nt);
57  const mVisTrans* getDisplayTransformation() const
58  { return transformation_; }
59 
60  osg::Array* osgArray() { return osgnormals_; }
61  const osg::Array* osgArray() const { return osgnormals_; }
62 
63 protected:
64  ~Normals();
69 
71 
72  osg::Array* osgnormals_;
73  friend class DoTransformation;
74 
75 };
76 
78 {
79 public:
81  : normals_( n )
82  { normals_.ref(); }
83 
84  int nextID(int previd) const{ return normals_.nextID(previd); }
85 
86  int add(const Coord3& n ) { return normals_.addNormal(n); }
87  void set(int idx,const Coord3& n) { normals_.setNormal(idx,n); }
88  void remove(int idx) { normals_.removeNormal(idx); }
89  Coord3 get(int idx) const { return normals_.getNormal(idx); }
90  void addValue(int idx, const Coord3& n)
91  { normals_.addNormalValue(idx,n ); }
92  bool isDefined(int idx) const
93  { return normals_.getNormal(idx).isDefined(); }
94  void remove(const TypeSet<int>&);
95  int size() const { return normals_.nrNormals(); }
96 
97  Normals* getNormals() { return &normals_; }
98 
99 protected:
100  ~NormalListAdapter() { normals_.unRef(); }
101 
103 };
104 
105 };
void addValue(int idx, const Coord3 &n)
Adds value to existing value at id.
Definition: visnormals.h:90
#define mExpClass(module)
Definition: commondefs.h:157
bool isDefined(int idx) const
Definition: visnormals.h:92
Interface for a list of Coord3 with automatically maintained IDs.
Definition: positionlist.h:70
int size() const
Definition: visnormals.h:95
DataObject is the base class off all objects that are used in Visualization and ought to be shared in...
Definition: visdata.h:59
void clear(std::ios &)
const visBase::Transformation * transformation_
Definition: visnormals.h:70
interface to threads that should be portable.
Definition: atomic.h:24
~NormalListAdapter()
Definition: visnormals.h:100
3D point or vector
Definition: commontypes.h:57
osg::Array * osgnormals_
Definition: visnormals.h:72
Definition: visnormals.h:29
osg::Array * osgArray()
Definition: visnormals.h:60
#define mVisTrans
Definition: visdata.h:25
Normals & normals_
Definition: visnormals.h:102
static Normals * create()
Definition: visnormals.h:32
NormalListAdapter(Normals &n)
Definition: visnormals.h:80
Definition: visnormals.h:77
int add(const Coord3 &n)
Return new id, or -1 if unsuccessful.
Definition: visnormals.h:86
Definition: visannot.h:40
TypeSet< int > unusednormals_
Definition: visnormals.h:67
const osg::Array * osgArray() const
Definition: visnormals.h:61
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
Threads::Mutex & mutex_
Definition: visnormals.h:68
#define mCreateDataObj(clss)
Definition: visdata.h:210
Normals * getNormals()
Definition: visnormals.h:97
int nextID(int previd) const
Definition: visnormals.h:84

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