OpendTect  6.3
viscoord.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 #include "visosg.h"
15 #include "visdata.h"
16 #include "notify.h"
17 #include "positionlist.h"
18 #include "thread.h"
19 
20 
21 class UTMPosition;
22 
23 namespace Geometry { class PosIdHolder; }
24 
25 namespace osg { class Array; }
26 
27 
28 namespace visBase
29 {
30 
31 
32 class Transformation;
33 class Normals;
34 
35 class CoordinatesOsgImpl;
36 
46 {
47 public:
48 
50  static Coordinates* create()
52  friend class CoordinatesBuilder;
53  friend class CoordListAdapter;
54 
55  void setDisplayTransformation(const mVisTrans*);
61  const mVisTrans* getDisplayTransformation() const;
62 
63  void copyFrom(const Coordinates&);
64 
65  int nextID(int previd) const;
68  int size(bool includedelete=false) const;
69  int addPos(const Coord3&);
70  int addPos(const Coord3f&,bool scenespace=false);
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);
97  void setPosWithoutLock(int, const Coord3f&,bool scenespace);
100  int getFreeIdx();
103  ~Coordinates();
104 
108 
109  osg::Array* osgcoords_;
110  friend class SetOrGetCoordinates;
111 };
112 
113 
115 {
116 public:
118 
119  virtual int size() const;
120  virtual bool setSize(int,bool cpdata);
121 
122  virtual void setCoord(int,const float*);
123  virtual void getCoord(int,float*) const;
124 
125  virtual void setNormal(int,const float*);
126  virtual void getNormal(int,float*) const;
127 
128  virtual void setTCoord(int,const float*);
129  virtual void getTCoord(int,float*) const;
130 
131 protected:
133 
136 };
137 
138 
143 {
144 public:
146 
147  int nextID(int) const;
148  int add(const Coord3&);
149  Coord3 get(int) const;
150  void set(int,const Coord3&);
151  void remove(int);
152  bool isDefined(int) const;
153  void addValue(int,const Coord3&);
154  int size() const { return coords_.size(); }
155  void remove(const TypeSet<int>&);
156 
157  Coordinates* getCoordinates() { return &coords_; }
158 
159 protected:
160  virtual ~CoordListAdapter();
162 
163 };
164 
165 };
#define mExpClass(module)
Definition: commondefs.h:157
Normals * normals_
Definition: viscoord.h:134
Interface for a list of Coord3 with automatically maintained IDs.
Definition: positionlist.h:70
Notifier< Coordinates > change
Definition: viscoord.h:49
DataObject is the base class off all objects that are used in Visualization and ought to be shared in...
Definition: visdata.h:59
Base class for vertex attribute list.
Definition: positionlist.h:22
Class to help setup a callback handling.
Definition: notify.h:121
3D point or vector
Definition: commontypes.h:57
Set of (small) copyable elements.
Definition: commontypes.h:26
Definition: visnormals.h:29
Definition: viscoord.h:142
TypeSet< int > unusedcoords_
Definition: viscoord.h:105
#define mVisTrans
Definition: visdata.h:25
Threads::Mutex mutex_
Definition: viscoord.h:106
Coordinates * getCoordinates()
Definition: viscoord.h:157
const visBase::Transformation * transformation_
Definition: viscoord.h:107
A set of coordinates. The coordinates will be transformed by the transformation before given to Coin...
Definition: viscoord.h:45
Definition: visannot.h:40
const osg::Array * osgArray() const
Definition: viscoord.h:84
osg::Array * osgcoords_
Definition: viscoord.h:109
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
Open Scene Graph.
Definition: visannot.h:26
int size() const
Definition: viscoord.h:154
#define mCreateDataObj(clss)
Definition: visdata.h:210
Definition: viscoord.h:114
static Coordinates * create()
Definition: viscoord.h:50
Definition: arraytesselator.h:19
Coordinates & coords_
Definition: viscoord.h:135
Coordinates & coords_
Definition: viscoord.h:161
bool isEmpty() const
Definition: viscoord.h:87

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