VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvCore
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
>
18
#include <
vrvUtil/DtConfiguration.h
>
19
20
#include <list>
21
#include <set>
22
23
namespace
makVrv
24
{
27
class
DT_DLL_VRVCORE
DtMenuConfiguration
:
public
DtConfiguration
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
:
38
DtMenuConfiguration
();
39
41
~
DtMenuConfiguration
();
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
79
DtMenuConfiguration
& operator=(
const
DtMenuConfiguration
& rhs)
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
102
struct
OrderParameters
103
{
104
OrderParameters
()
105
: orderWeight(0)
106
, relative(
DtMenuPath
::empty())
107
, beforeRelative(false)
108
{
109
}
110
111
int
orderWeight
;
112
DtMenuPath
relative
;
113
bool
beforeRelative
;
114
};
115
116
MenuPathSet
myMenuPaths
;
117
118
typedef
std::map<DtMenuPath,OrderParameters>
MenuPathOrderMap
;
119
MenuPathOrderMap
myMenuOrder
;
120
121
int
myCurrentWeight
;
122
};
123
}
124
125
#endif
126
Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)