GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_selectionset.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  *****************************************************************************/
23 
24 #ifndef GLC_SELECTIONSET_H_
25 #define GLC_SELECTIONSET_H_
26 
27 #include <QHash>
28 #include <QList>
29 #include <QSet>
30 
31 #include "glc_structoccurence.h"
32 #include "../glc_global.h"
33 
34 #include "../glc_config.h"
35 
36 class GLC_WorldHandle;
37 
40 
41 
43 {
45 
47 
48 
49 public:
52  virtual ~GLC_SelectionSet();
53 
55 
57 
59 
60 public:
61 
63  bool isEmpty() const;
64 
66  inline int size() const
67  {return count();}
68 
70  int count() const;
71 
73  QList<GLC_StructOccurence*> occurencesList() const;
74 
76  bool contains(const GLC_StructOccurence* pOccurence) const
77  {return contains(pOccurence->id());}
78 
80  bool contains(GLC_uint occurenceId) const
81  {return m_OccurenceHash.contains(occurenceId);}
82 
84 
85 
87 
88 public:
90 
91  bool insert(GLC_StructOccurence* pOccurence);
92 
94 
95  bool insert(GLC_uint occurenceId);
96 
98 
99  bool remove(GLC_StructOccurence* pOccurence);
100 
102 
103  bool remove(GLC_uint occurenceId);
104 
106  void clear();
107 
109 
111 // Private members
113 private:
116 
118  QHash<GLC_uint, GLC_StructOccurence*> m_OccurenceHash;
119 
120 };
121 
122 #endif /* GLC_SELECTIONSET_H_ */

©2005-2013 Laurent Ribon