OpendTect-6_4  6.4
uidpscrossplottools.h
Go to the documentation of this file.
1 #ifndef uidpscrossplottools_h
2 #define uidpscrossplottools_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Satyaki Maitra
9  Date: June 2011
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uiiomod.h"
16 #include "uiiomod.h"
17 #include "uigeom.h"
18 #include "polygon.h"
19 
20 
21 mStruct(uiIo) SelectionArea
22 {
23  enum SelAxisType { Y1, Y2, Both };
24 
25  SelectionArea(const uiRect&);
26  SelectionArea(const ODPolygon<int>&);
27  SelectionArea(bool isrect);
28  SelectionArea() : axistype_(SelectionArea::Y1) {}
29  ~SelectionArea();
30 
31  bool isrectangle_;
32  bool isInside(const uiPoint&) const;
33  bool isValid() const;
34  Interval<double> getValueRange(bool forx,bool alt=false) const;
35  BufferStringSet getAxisNames() const;
36  uiPoint center() const;
37  float selectedness(uiPoint) const;
38 
39 
40  BufferString xaxisnm_;
41  BufferString yaxisnm_;
42  BufferString altyaxisnm_;
43  int id_;
44  uiRect rect_;
45  ODPolygon<int> poly_;
46  SelAxisType axistype_;
47  uiWorldRect worldrect_;
48  ODPolygon<double> worldpoly_;
49  uiWorldRect altworldrect_;
50  ODPolygon<double> altworldpoly_;
51  uiPoint center_;
52  bool operator==(const SelectionArea&) const;
53  void geomChanged() { maxdistest_ = mUdf(double); }
54  // has to be called after pts changed only if
55  // you want maxdistest_
56 
57 protected:
58 
59  mutable double maxdistest_;
60  double minDisToBorder(uiPoint) const;
61  // only for inside pts
62  double maxDisToBorder() const;
63 };
64 
65 
67 {
68 public:
69  SelectionGrp(const char* nm, const Color& col)
70  : NamedObject(nm), col_(col) {}
72  : NamedObject() {}
74 
76  int size() const;
77  bool hasAltAxis() const;
78  bool isValidIdx(int idx) const;
79  int isInside(const uiPoint&) const;
80  // return selarea id || - 1 if not selected
81  int validIdx(int selareaid) const;
82  void addSelection(const SelectionArea&);
83  void removeSelection(int);
84  void removeAll();
85 
86  void setSelectionArea(const SelectionArea&);
87  bool getSelectionArea(SelectionArea&,int id) const;
88  SelectionArea& getSelectionArea(int idx);
89  const SelectionArea& getSelectionArea(int idx) const;
90  SelectionArea::SelAxisType getSelectionAxis(int selareaid) const;
91  void usePar(const IOPar&);
92  void fillPar(IOPar&) const;
93  void getInfo(BufferString&) const;
94 protected:
96 };
97 
98 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Definition: uigeom.h:42
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
#define mStruct(module)
Definition: commondefs.h:165
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
Color col_
Definition: uidpscrossplottools.h:75
Set of BufferString objects.
Definition: bufstringset.h:28
~SelectionGrp()
Definition: uidpscrossplottools.h:73
void removeAll()
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
SelectionGrp(const char *nm, const Color &col)
Definition: uidpscrossplottools.h:69
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
Definition: uidpscrossplottools.h:66
SelectionGrp()
Definition: uidpscrossplottools.h:71
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Object with a name.
Definition: namedobj.h:35
TypeSet< SelectionArea > selareas_
Definition: uidpscrossplottools.h:95
Color is an RGB color object, with a transparancy. The storage is in a 4-byte integer, similar to Qt.
Definition: color.h:26

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