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

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