OpendTect-6_4  6.4
viscoord.h
Go to the documentation of this file.
1 
2 #ifndef viscoord_h
3 #define viscoord_h
4 
5 /*+
6 ________________________________________________________________________
7 
8  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
9  Author: Kristofer Tingdahl
10  Date: 4-11-2002
11  RCS: $Id$
12 ________________________________________________________________________
13 
14 
15 -*/
16 #include "visbasemod.h"
17 #include "callback.h"
18 #include "positionlist.h"
19 #include "thread.h"
20 #include "visdata.h"
21 #include "visosg.h"
22 
23 
24 class UTMPosition;
25 
26 namespace Geometry { class PosIdHolder; }
27 
28 namespace osg { class Array; }
29 
30 
31 namespace visBase
32 {
33 class Transformation;
34 class Normals;
35 
36 class CoordinatesOsgImpl;
37 
47 {
48 public:
49 
51  static Coordinates* create()
53  friend class CoordinatesBuilder;
54  friend class CoordListAdapter;
55 
56  void setDisplayTransformation(const mVisTrans*);
62  const mVisTrans* getDisplayTransformation() const;
63 
64  void copyFrom(const Coordinates&);
65 
66  int nextID(int previd) const;
69  int size(bool includedelete=false) const;
70  int addPos(const Coord3&);
71  Coord3 getPos(int,bool scenespace=false) const;
72  bool isDefined(int) const;
73  void setPos(int,const Coord3&);
74  void setPositions(const Coord3*,int sz,int start,
75  bool scenespace=false);
76  void insertPos(int,const Coord3&);
77  void removePos(int, bool keepidxafter=true );
78  void removeAfter(int);
79  void setAllPositions(const Coord3& pos,int sz,int start);
80 
81  void setAllZ(const float*,int sz,bool dotransf);
82 
83  osg::Array* osgArray() { return osgcoords_; }
84  const osg::Array* osgArray() const { return osgcoords_; }
85 
86  void setEmpty();
87  bool isEmpty() const { return size()==0; }
88  void dirty() const;
89 
90 protected:
91 
92  void getPositions(TypeSet<Coord3>&) const;
93  void setPositions(const TypeSet<Coord3>&);
94 
95  void setPosWithoutLock(int, const Coord3&,bool scenespace);
98  int getFreeIdx();
101  ~Coordinates();
102 
106 
107  osg::Array* osgcoords_;
108  friend class SetOrGetCoordinates;
109 };
110 
111 
113 {
114 public:
116 
117  virtual int size() const;
118  virtual bool setSize(int,bool cpdata);
119 
120  virtual void setCoord(int,const float*);
121  virtual void getCoord(int,float*) const;
122 
123  virtual void setNormal(int,const float*);
124  virtual void getNormal(int,float*) const;
125 
126  virtual void setTCoord(int,const float*);
127  virtual void getTCoord(int,float*) const;
128 
129 protected:
131 
134 };
135 
136 
141 {
142 public:
144 
145  int nextID(int) const;
146  int add(const Coord3&);
147  Coord3 get(int) const;
148  void set(int,const Coord3&);
149  void remove(int);
150  bool isDefined(int) const;
151  void addValue(int,const Coord3&);
152  int size() const { return coords_.size(); }
153  void remove(const TypeSet<int>&);
154 
155  Coordinates* getCoordinates() { return &coords_; }
156 
157 protected:
158  virtual ~CoordListAdapter();
160 
161 };
162 
163 };
164 
165 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Normals * normals_
Definition: viscoord.h:132
Interface for a list of Coord3 with automatically maintained IDs.
Definition: positionlist.h:72
Notifier< Coordinates > change
Definition: viscoord.h:50
DataObject is the base class off all objects that are used in Visualization and ought to be shared in...
Definition: visdata.h:65
Base class for vertex attribute list.
Definition: positionlist.h:24
Definition: callback.h:254
Definition: visnormals.h:32
Definition: viscoord.h:140
TypeSet< int > unusedcoords_
Definition: viscoord.h:103
#define mVisTrans
Definition: visdata.h:31
Threads::Mutex mutex_
Definition: viscoord.h:104
Coordinates * getCoordinates()
Definition: viscoord.h:155
const visBase::Transformation * transformation_
Definition: viscoord.h:105
A cartesian coordinate in 3D space.
Definition: coord.h:72
A set of coordinates. The coordinates will be transformed by the transformation before given to Coin...
Definition: viscoord.h:46
Definition: visannot.h:43
const osg::Array * osgArray() const
Definition: viscoord.h:84
osg::Array * osgcoords_
Definition: viscoord.h:107
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
Open Scene Graph.
Definition: visannot.h:29
int size() const
Definition: viscoord.h:152
#define mCreateDataObj(clss)
Definition: visdata.h:209
Definition: viscoord.h:112
static Coordinates * create()
Definition: viscoord.h:51
Definition: arraytesselator.h:21
Coordinates & coords_
Definition: viscoord.h:133
Coordinates & coords_
Definition: viscoord.h:159
bool isEmpty() const
Definition: viscoord.h:87

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