anatomist  5.1.2
3D neuroimaging data viewer
objectparamselect.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 
35 #ifndef ANA_OBJECT_OBJECTPARAMSELECT_H
36 #define ANA_OBJECT_OBJECTPARAMSELECT_H
37 
38 #include <qdialog.h>
39 #include <qwidget.h>
40 #include <set>
41 
42 class QListWidget;
43 
44 namespace anatomist
45 {
46  class AObject;
47 }
48 
49 
50 class ObjectParamSelect : public QWidget
51 {
52  Q_OBJECT
53 
54 public:
55  typedef bool (*Filter)( const anatomist::AObject* );
56  enum ViewMode
57  {
59  All,
60  TopLevel //,
61  };
62 
63  ObjectParamSelect( const std::set<anatomist::AObject *> &,
64  QWidget* parent );
65  virtual ~ObjectParamSelect();
66 
67  virtual void addFilter( Filter );
68  virtual bool filter( const anatomist::AObject* o ) const;
69  // update object label after objects list has changed (object destroyed...)
70  void updateLabel( const std::set<anatomist::AObject *> & );
75  const std::set<anatomist::AObject *> & selectedObjects() const;
76 
77 signals:
79  void objectsSelected( const std::set<anatomist::AObject *> & );
80 
81 public slots:
82  virtual void selectObjects();
83  virtual void selectObjects( const std::set<anatomist::AObject *> & obj,
84  const std::set<anatomist::AObject *> & sel );
85 
86 protected slots:
87  void setObjectsViewMode( int );
88 
89 private:
90  struct Private;
91  Private *d;
92 
93  void drawContents();
94 };
95 
96 
97 class ObjectChooseDialog : public QDialog
98 {
99  Q_OBJECT
100 
101 public:
102  ObjectChooseDialog( const std::set<anatomist::AObject *> & obj,
103  const std::set<anatomist::AObject *> & sel,
104  ObjectParamSelect* s, QWidget* parent = 0 );
106 
107  const QListWidget* list() const;
108  int objectsViewMode() const;
109 
110 public slots:
111  void setObjectsViewMode( int );
112 
113 private:
114  struct Private;
115  Private *d;
116 };
117 
118 
119 #endif
120 
#define slots
const QListWidget * list() const
ObjectChooseDialog(const std::set< anatomist::AObject * > &obj, const std::set< anatomist::AObject * > &sel, ObjectParamSelect *s, QWidget *parent=0)
virtual ~ObjectChooseDialog()
int objectsViewMode() const
void setObjectsViewMode(int)
virtual void addFilter(Filter)
virtual void selectObjects()
ObjectParamSelect(const std::set< anatomist::AObject * > &, QWidget *parent)
const std::set< anatomist::AObject * > & selectedObjects() const
there objects are passed by the objectsSelected signal.
virtual ~ObjectParamSelect()
virtual void selectObjects(const std::set< anatomist::AObject * > &obj, const std::set< anatomist::AObject * > &sel)
bool(* Filter)(const anatomist::AObject *)
void setObjectsViewMode(int)
virtual bool filter(const anatomist::AObject *o) const
void updateLabel(const std::set< anatomist::AObject * > &)
void objectsSelected(const std::set< anatomist::AObject * > &)
Base Anatomist object (abstract)
Definition: Object.h:96