UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zqb_pixgrpmanager.hpp
1 /* zqb_pixgrpmanager.hpp */
2 /* $Id: zqb_pixgrpmanager.hpp 20080 2009-12-15 15:57:52Z vlad $ */
3 #ifndef __zqb_pixgrpmanager_hpp
4 #define __zqb_pixgrpmanager_hpp
5 
6 
7 #include <string>
8 #include <vector>
9 #include <map>
10 
11 #include "zqb_pixgroup.hpp"
12 
13 
18 typedef std::map<std::string,ZqbPixGroup*> ZqbPixGroups;
19 
20 
25 typedef std::vector<std::string> ZqbPixGroupsOrder;
26 
27 
50 class ZqbPixGrpManager : virtual public ZqbAutoName
51 {
52 public:
53 
55  ZqbPixGrpManager (const char* szName = NULL);
56 
57 
58  /*
59  * Groups control and geometry
60  */
61 
65  ZqbPixGroup* group (const char* szGrpName);
66 
68  ZqbPixGroup* operator[] (const char* szGrpName)
69  {
70  return group(szGrpName);
71  }
72 
75  bool known (const char* szGrpName) const;
76 
79  void resetGroupsOrder ();
80 
85  void resetGroupsWeight ();
86 
94  void setGroupsWeight (const char* szParent,
95  const char* szGrpName1, /* double fGrpWeight1,
96  szGrpName2, fGrpWeight2, etc */
97  ...);
98 
102  void setGroupsOrder (const char* szParent,
103  const char* szGrpName1,
104  /* szGrpName2, etc */
105  ...);
106 
110  void setGroupsOrder (const char* szParent,
111  std::vector<std::string> grpNames);
112 
113 
118  int placeGroups (int iStart, int iSize);
119 
120 
121  /*
122  * Geometry parameters for children of top level group
123  */
124 
127  void setSpace (int iSpace);
128 
131  int getSpace () const;
132 
133 
136  void setMargin (int iMargin);
137 
140  int getMargin () const;
141 
142 
143 protected:
144 
151  int propPlacement (const ZqbPixGroupsOrder& rGroups,
152  int iStart, int iSize,
153  int iSpace, int iMargin);
154 
160  int placeGroups (const char* szParent,
161  const ZqbPixGroupsOrder& rGroups,
162  int iStart, int iSize,
163  int iSpace, int iMargin);
164 
168  void filterGroups (const char* szFilter,
169  const ZqbPixGroupsOrder& rAllGroups,
170  ZqbPixGroupsOrder* pFilteredGroups,
171  ZqbPixGroupsOrder* pOtherGroups = NULL);
172 
174  ZqbPixGroups m_Groups;
175 
179  ZqbPixGroupsOrder m_Order;
180 
182  int m_iSpace;
183 
185  int m_iMargin;
186 
187 private:
188 
190  static int s_iNameCounter;
191 
192 };
193 
194 
195 #endif /* zqb_pixgrpmanager.hpp */
int m_iMargin
Definition: zqb_pixgrpmanager.hpp:178
int m_iSpace
Definition: zqb_pixgrpmanager.hpp:175
int propPlacement(const ZqbPixGroupsOrder &rGroups, int iStart, int iSize, int iSpace, int iMargin)
ZqbPixGroupsOrder m_Order
Definition: zqb_pixgrpmanager.hpp:172
void setMargin(int iMargin)
void resetGroupsOrder()
int getMargin() const
void setGroupsWeight(const char *szParent, const char *szGrpName1,...)
Definition: zqb_autoname.hpp:18
void setGroupsOrder(const char *szParent, const char *szGrpName1,...)
void setSpace(int iSpace)
bool known(const char *szGrpName) const
int getSpace() const
void filterGroups(const char *szFilter, const ZqbPixGroupsOrder &rAllGroups, ZqbPixGroupsOrder *pFilteredGroups, ZqbPixGroupsOrder *pOtherGroups=NULL)
ZqbPixGrpManager(const char *szName=NULL)
ZqbPixGroup * group(const char *szGrpName)
ZqbPixGroup * operator[](const char *szGrpName)
Definition: zqb_pixgrpmanager.hpp:68
ZqbPixGroups m_Groups
Definition: zqb_pixgrpmanager.hpp:167
int placeGroups(int iStart, int iSize)
void resetGroupsWeight()
Definition: zqb_pixgroup.hpp:34
Definition: zqb_pixgrpmanager.hpp:50