VR-Forces 4.1.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
examples
objectFilter
objectFilterManager.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2012 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
6
//\file objectFilterManager.h
7
8
#pragma once
9
10
#include <
vrvUtil/DtVirtualBaseClass.h
>
11
#include <
vrvUtil/DtSignalConnectionManager.h
>
12
#include <
vrvCore/DtUniqueID.h
>
13
#include <
vrvCore/DtStateView.h
>
14
#include <
vrvCore/DtEntityState.h
>
15
16
#include <map>
17
18
namespace
makVrf
19
{
20
class
DtVrfSelectionFilter;
21
}
22
23
namespace
makVrv
24
{
25
class
DtDe;
26
class
DtSimObjectEntry;
27
}
28
29
//This class will be responsible for keeping track of filters that are used
30
//to show/hide objects in the system. It will make connections for new object
31
//additions as well as updates to those objects. When an object is added or
32
//updated it will be passed through the set of filters for visibility.
33
class
DtObjectFilterManager
:
public
makVrv::DtVirtualBaseClass
34
{
35
public
:
36
//CTOR
37
DtObjectFilterManager
(
makVrv::DtDe
& de);
38
39
//DTOR
40
virtual
~DtObjectFilterManager
();
41
42
//Method that will be used to return the singleton of this manager that is registered with the DE.
43
//If not registered will create and register a singleton
44
static
DtObjectFilterManager
&
instance
(
makVrv::DtDe
&);
45
46
//Activate/deactive a filter for modifying visibility. If filter is active and already exists will
47
//not process. Same with deactivating and not having a filter exist
48
virtual
void
activateFilter
(
bool
,
const
makVrf::DtVrfSelectionFilter
&);
49
50
//Returns whether or not this filter is currently active
51
virtual
bool
filterActive
(
const
makVrf::DtVrfSelectionFilter
&)
const
;
52
53
protected
:
55
virtual
void
slot_simObjectEntryAboutToBeRemoved
(
makVrv::DtSimObjectEntry
& e);
56
58
virtual
void
slot_simStateAdded
(
makVrv::DtSimObjectEntry
& e);
59
61
virtual
void
slot_tick
();
62
65
virtual
void
slot_stateViewUpdated
(
makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>
*);
66
68
virtual
void
deactivateFilter
(
const
makVrf::DtVrfSelectionFilter
&);
69
virtual
void
deactivateFilter
(
const
makVrf::DtVrfSelectionFilter
&,
makVrv::DtElementID
);
70
72
virtual
void
activateFilter
(
const
makVrf::DtVrfSelectionFilter
&);
73
virtual
void
activateFilter
(
const
makVrf::DtVrfSelectionFilter
&,
makVrv::DtElementID
);
74
76
virtual
int
showHideContext
(
const
std::string& filter);
77
79
virtual
void
show
(
makVrv::DtElementID
,
int
context,
bool
makeVisible);
80
81
protected
:
82
makVrv::DtDe
&
myDe
;
83
84
typedef
std::map<std::string, makVrf::DtVrfSelectionFilter*>
FilterMap
;
85
FilterMap
myFilters
;
86
89
makVrv::DtSignalConnectionManager
myConnectionManager
;
90
94
96
typedef
std::map<std::string, bool>
FilterContextMap
;
97
struct
FilterContext
98
{
99
makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>
*
mySimulatedBaseState
;
100
FilterContextMap
myFilterContextMap
;
101
};
102
104
typedef
std::map<makVrv::DtElementID, FilterContext>
ElementContextMap
;
105
106
ElementContextMap
myElementContextMap
;
107
108
// Items that are waiting for vrlink context to show up for
109
std::map<makVrv::DtElementID, bool>
myWaiting
;
110
112
typedef
std::map<std::string, int>
ShowHideContextMap
;
113
ShowHideContextMap
myShowHideContextMap
;
114
};
Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)