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

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