OpendTect  6.3
vispolygonselection.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: K. Tingdahl
8  Date: June 2008
9 ________________________________________________________________________
10 
11 
12 -*/
13 
14 #include "visobject.h"
15 #include "selector.h"
16 #include "draw.h"
17 #include "thread.h"
18 
19 
20 namespace osgGeo{ class PolygonSelection; }
21 
22 template <class T> class ODPolygon;
23 
24 namespace visBase
25 {
26 class Material;
27 class SelectionCallBack;
28 class DrawStyle;
29 class Camera;
30 
38 {
39 public:
40 
43  enum SelectionType { Off, Rectangle, Polygon };
44  void setSelectionType(SelectionType);
45  SelectionType getSelectionType() const;
46 
47  void setLineStyle(const OD::LineStyle&);
48  const OD::LineStyle& getLineStyle() const;
49 
50  void clear();
51  bool hasPolygon() const;
52  bool singleSelection() const;
53  bool isSelfIntersecting() const;
54  bool isInside(const Coord3&,
55  bool displayspace=false) const;
56 
57  char includesRange(const Coord3& start,
58  const Coord3& stop,
59  bool displayspace ) const;
68  void setUTMCoordinateTransform(const mVisTrans*);
74  static Notifier<PolygonSelection>* polygonFinished();
75 
76  bool rayPickThrough(const Coord3& worldpos,
77  TypeSet<int>& pickedobjids,
78  int depthidx=0) const;
79  void setMasterCamera(Camera*);
80  void setHUDCamera(Camera*);
81  PolygonSelection* copy() const;
82 
83 protected:
85  const osgGeo::PolygonSelection*);
87  void polygonChangeCB(CallBacker*);
88 
89 
90 
92 
96 
97 
98  osgGeo::PolygonSelection* selector_;
100  SelectionCallBack* selectorcb_;
101 };
102 
103 
105 {
106 public:
109 
110  Selector<Coord3>* clone() const;
111  const char* selectorType() const;
112  bool isOK() const;
113  bool hasPolygon() const;
114  bool includes(const Coord3&) const;
115  bool canDoRange() const { return true; }
116  char includesRange(const Coord3& start,
117  const Coord3& stop) const;
118 
119 protected:
120  bool isEq(const Selector<Coord3>&) const;
121 
123 };
124 
125 };
#define mExpClass(module)
Definition: commondefs.h:157
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
keep osg camera status and render info
Definition: viscamera.h:27
Camera * mastercamera_
Definition: vispolygonselection.h:99
Lock that permits multiple readers to lock the object at the same time, but it will not allow any rea...
Definition: thread.h:141
SelectionType
Definition: vispolygonselection.h:43
Threads::ReadWriteLock polygonlock_
Definition: vispolygonselection.h:95
Definition: draw.h:119
(Closed) sequence of connected 2-D coordinates.
Definition: polygon.h:25
A collection of geoscientific extensions to OpenSceneGraph.
Definition: visannot.h:35
Definition: visdrawstyle.h:30
void clear(std::ios &)
const PolygonSelection & vissel_
Definition: vispolygonselection.h:122
const visBase::Transformation * utm2disptransform_
Definition: vispolygonselection.h:91
osgGeo::PolygonSelection * selector_
Definition: vispolygonselection.h:98
Class to help setup a callback handling.
Definition: notify.h:121
bool canDoRange() const
Definition: vispolygonselection.h:115
static PolygonSelection * create()
Definition: vispolygonselection.h:41
3D point or vector
Definition: commontypes.h:57
Definition: vispolygonselection.h:37
#define mVisTrans
Definition: visdata.h:25
SelectionCallBack * selectorcb_
Definition: vispolygonselection.h:100
Interface for classes that select on basis of a key.
Definition: selector.h:23
Definition: visannot.h:40
Definition: vispolygonselection.h:104
ODPolygon< double > * polygon_
Definition: vispolygonselection.h:94
void copy(TypeSetBase< T, I > &to, const TypeSetBase< S, I > &from)
Definition: typeset.h:221
#define mCreateDataObj(clss)
Definition: visdata.h:210
Definition: visobject.h:67
Definition: seistype.h:25
DrawStyle * drawstyle_
Definition: vispolygonselection.h:93

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