VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtMenuConfiguration.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtMenuConfiguration.h,v $ $Revision: 1.9 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtMenuConfiguration_H_
14 #define DtMenuConfiguration_H_
15 
16 #include <vrvCore/vrvCore.h>
17 #include <vrvCore/DtMenuPath.h>
19 
20 #include <list>
21 #include <set>
22 
23 namespace makVrv
24 {
28  {
29  public:
30 
31  //Ordered vector of paths.
32  typedef std::list<DtMenuPath> MenuPathList;
33 
34  typedef std::set<DtMenuPath> MenuPathSet;
35 
36  public:
39 
42 
44  void addMenuPath(const DtMenuPath&, int weight = -1);
45 
49  void addMenuPathAfter(const DtMenuPath& newPath, const DtMenuPath& relativeTo);
50 
52  void addMenuPathBefore(const DtMenuPath& newPath, const DtMenuPath& relativeTo);
53 
55  void addConfiguration(const DtMenuConfiguration& subConfiguration);
56 
58  void removeMenuPath(const DtMenuPath&);
59 
61  void getRootPaths(MenuPathList& children) const;
62 
71  void getChildren(const DtMenuPath& path, MenuPathList& children) const;
72 
74  void sortChildren(MenuPathList& children) const;
75 
77  int getNewWeight();
78 
80  {
81  if (this != &rhs)
82  {
83  myMenuPaths = rhs.myMenuPaths;
84  myMenuOrder = rhs.myMenuOrder;
85  myCurrentWeight = rhs.myCurrentWeight;
86  }
87 
88  return *this;
89  }
90 
93  void merge(const DtMenuConfiguration& rhs);
94 
96  bool hasMenuPath(const DtMenuPath& p) const;
97 
98  protected:
99 
100  bool sortAbsolute(const DtMenuPath& a, const DtMenuPath& b) const;
101 
103  {
105  : orderWeight(0)
106  , relative(DtMenuPath::empty())
107  , beforeRelative(false)
108  {
109  }
110 
114  };
115 
117 
118  typedef std::map<DtMenuPath,OrderParameters> MenuPathOrderMap;
120 
122  };
123 }
124 
125 #endif
126 

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)