OpendTect-6_4  6.4
uistratselunits.h
Go to the documentation of this file.
1 #ifndef uistratselunits_h
2 #define uistratselunits_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: July 2011
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "uistratmod.h"
16 #include "uigroup.h"
17 #include "stratunitrefiter.h"
18 class uiStratSelUnitsListItem;
19 class uiTreeView;
20 class uiComboBox;
21 
22 
23 
25 {
26 public:
27 
28  enum Type { Simple, Single, Multi };
29 
30  mExpClass(uiStrat) Setup
31  {
32  public:
33 
35  : type_(t)
36  , pol_(p)
37  , maxnrlines_(12)
38  , autochoosechildparent_(true)
39  , chooseallinitial_(false)
40  , fldtxt_(t==Multi?"Units":"Unit") {}
41 
42  mDefSetupMemb(Type,type)
44  mDefSetupMemb(int,maxnrlines)
46  mDefSetupMemb(bool,chooseallinitial)
47  mDefSetupMemb(bool,autochoosechildparent)
48  };
51 
53  const Strat::NodeUnitRef&,
54  const Setup&);
55  ~uiStratSelUnits();
56 
57  bool isChosen(const Strat::UnitRef&) const;
58  bool isPresent(const Strat::UnitRef&) const;
59  const Strat::UnitRef* firstChosen() const;
60  void getChosen(ObjectSet<const Strat::UnitRef>&) const;
61  void setCurrent(const Strat::UnitRef&);
62  void setChosen(const Strat::UnitRef&,bool yn=true);
63  void setExpanded(int dpth=mUdf(int)); // not for Simple
64 
69 
70 protected:
71 
75 
79 
80  void mkBoxFld();
81  void mkTreeFld();
82 
83  void curChg(CallBacker*);
84  void choiceChg(CallBacker*);
85  void treeFinalSel(CallBacker*);
86 
87  inline bool isMulti() const { return setup_.type_==Multi; }
88  void checkParent(const Strat::UnitRef*);
89  void checkChildren(const Strat::UnitRef*,bool);
90  void chooseRelated(const Strat::UnitRef*,bool);
91  void unChooseParentIfLast(const Strat::UnitRef*);
92 
93  uiStratSelUnitsListItem* find(const Strat::UnitRef*);
94  const uiStratSelUnitsListItem* find( const Strat::UnitRef* ur ) const
95  { return const_cast<uiStratSelUnits*>(this)->find(ur); }
96 
97 };
98 
99 
100 #endif
Definition: uigroup.h:54
#define mExpClass(module)
Definition: commondefs.h:160
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
Setup(Type t, Strat::UnitRefIter::Pol p)
Definition: uistratselunits.h:34
Type
Definition: uistratselunits.h:28
ObjectSet< uiStratSelUnitsListItem > lvitms_
Definition: uistratselunits.h:74
bool doingautochoose_
Definition: uistratselunits.h:78
bool isPresent(const char *) const
const Strat::NodeUnitRef & topnode_
Definition: uistratselunits.h:76
uiTreeView * tree_
Definition: uistratselunits.h:73
Combo box.
Definition: uicombobox.h:32
Definition: uiparent.h:26
Set of pointers to objects.
Definition: commontypes.h:32
uiComboBox * combo_
Definition: uistratselunits.h:72
Definition: uistratselunits.h:30
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
UnitRef for units containing other units only.
Definition: stratunitref.h:118
#define mDefSetupMemb(typ, memb)
Definition: commondefs.h:137
Definition: uitreeview.h:33
Reference data for a stratigraphic unit.
Definition: stratunitref.h:38
const T * find(const ObjectSet< T > &os, const S &val)
Get const object in set.
Definition: objectset.h:183
Setup setup_
Definition: uistratselunits.h:77
Notifier< uiStratSelUnits > currentChanged
Definition: uistratselunits.h:65
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Definition: uistratselunits.h:24
const Strat::UnitRef * curunit_
Definition: uistratselunits.h:68
bool isMulti() const
Definition: uistratselunits.h:87
Notifier< uiStratSelUnits > unitChosen
Only issued for Multi.
Definition: uistratselunits.h:66
Pol
Definition: stratunitrefiter.h:34
Notifier< uiStratSelUnits > unitPicked
Only for Single.
Definition: uistratselunits.h:67
const uiStratSelUnitsListItem * find(const Strat::UnitRef *ur) const
Definition: uistratselunits.h:94

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