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,v 1.7 2006/04/25 09:00:25 guser1 Exp $ */
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 
111  int placeGroups (int iStart, int iSize);
112 
113 
114  /*
115  * Geometry parameters for children of top level group
116  */
117 
120  void setSpace (int iSpace);
121 
124  int getSpace () const;
125 
126 
129  void setMargin (int iMargin);
130 
133  int getMargin () const;
134 
135 
136 protected:
137 
144  int propPlacement (const ZqbPixGroupsOrder& rGroups,
145  int iStart, int iSize,
146  int iSpace, int iMargin);
147 
153  int placeGroups (const char* szParent,
154  const ZqbPixGroupsOrder& rGroups,
155  int iStart, int iSize,
156  int iSpace, int iMargin);
157 
161  void filterGroups (const char* szFilter,
162  const ZqbPixGroupsOrder& rAllGroups,
163  ZqbPixGroupsOrder* pFilteredGroups,
164  ZqbPixGroupsOrder* pOtherGroups = NULL);
165 
167  ZqbPixGroups m_Groups;
168 
172  ZqbPixGroupsOrder m_Order;
173 
175  int m_iSpace;
176 
179 
180 private:
181 
183  static int s_iNameCounter;
184 
185 };
186 
187 
188 #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