20 #include <boost/bind.hpp>
134 if(isCompatible(entry))
137 onSimObjectEntryAboutToBeRemoved(entry);
142 myStateViewMap[entry.
id()] = sview;
143 signal_stateViewAdded(*sview);
150 if(isCompatible(state))
153 onSimObjectStateEntryAboutToBeRemoved(entry, state);
158 myStateViewMap[entry.
id()] = sview;
159 signal_stateViewAdded(*sview);
167 if(isCompatible(entry))
169 typename StateViewMap::iterator iter = myStateViewMap.find(entry.
id());
170 if(iter != myStateViewMap.end())
172 signal_stateViewAboutToBeRemoved(*iter->second );
174 myStateViewMap.erase(iter);
183 if(isCompatible(state))
185 typename StateViewMap::iterator iter = myStateViewMap.find(entry.
id());
186 if(iter != myStateViewMap.end())
188 signal_stateViewAboutToBeRemoved(*iter->second );
190 myStateViewMap.erase(iter);
210 return myStateViewMap.size();
216 DtSimData::SimEntryMap::const_iterator pos;
217 for(pos=myDe.dataBank().simData().simEntryMap().begin();
218 pos != myDe.dataBank().simData().simEntryMap().end(); ++pos )
223 onSimObjectEntryAdded(*pEntry);
233 typename StateViewMap::const_iterator pos;
234 for(pos = myStateViewMap.begin(); pos != myStateViewMap.end(); ++pos )
236 pos->second->setUpdateRate(myRate);
243 return myStateViewMap;
249 typename StateViewMap::const_iterator iter = myStateViewMap.find(
id);
250 return (iter != myStateViewMap.end());
256 typename StateViewMap::const_iterator iter = myStateViewMap.find(
id);
257 if(iter != myStateViewMap.end())
void onSimObjectEntryAboutToBeRemoved(DtSimObjectEntry &entry)
Called when a DtSimObjectEntry is about to be removed.
Definition: DtStateViewCollection.h:164
boost::signalslib::signal< void(const DtStateView< T > &)> signal_stateViewAboutToBeRemoved
Signal emitted when a DtStateView is about to be removed.
Definition: DtStateViewCollection.h:63
bool hasStateView(DtUniqueID id) const
Returns true if a state view with that ID exists.
Definition: DtStateViewCollection.h:247
DtSignalConnectionManager myConnections
Definition: DtStateViewCollection.h:93
UpdateRate
Definition: DtSimEntryUpdater.h:31
DtUniqueID id() const
Return the unique Id of this entry.
void setUpdateRate(DtSimEntryUpdater::UpdateRate rate)
Set the rate of every state view in the container.
Definition: DtStateViewCollection.h:229
The DtSimData is the repository for simulation specific, read only data. The DtSimData has a map of D...
Definition: DtSimData.h:31
void onSimObjectStateEntryAboutToBeRemoved(DtSimObjectEntry &entry, DtSimState &)
Called when a DtSimState is about to be removed from a DtSimObjectEntry.
Definition: DtStateViewCollection.h:180
Contains makVrv::DtStateView class.
virtual ~DtStateViewCollection()
DTOR.
Definition: DtStateViewCollection.h:124
Contains makVrv::DtDe class.
const DtStateView< T > * findStateView(DtUniqueID id) const
Find DtStateView by id.
Definition: DtStateViewCollection.h:254
void onSimObjectStateEntryAdded(DtSimObjectEntry &entry, DtSimState &)
Called when a DtSimState is added to a DtSimObjectEntry.
Definition: DtStateViewCollection.h:148
virtual DtDataBank & dataBank()
The DtDataBank accessor.
DtSimEntryUpdater::UpdateRate myRate
Definition: DtStateViewCollection.h:92
binderNoArgs< _Fn > bind(const _Fn &_Func, const _Ty &_Left)
Definition: DtSTLUtilities.h:76
A DtSimObjectEntry is an entry for a persistent simulation object like an entity. ...
Definition: DtSimObjectEntry.h:22
Contains makVrv::DtSimObjectEntry class.
void onSimObjectEntryAdded(DtSimObjectEntry &entry)
Called when a DtSimObjectEntry is added.
Definition: DtStateViewCollection.h:132
const StateViewMap & stateViewMap() const
Return the map of DtStateViews's in this collection.
Definition: DtStateViewCollection.h:241
A DtStateViewCollection is a collection of DtStateViews of a specific state.
Definition: DtStateViewCollection.h:27
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
boost::signalslib::signal< void(DtSimObjectEntry &)> signal_simObjectEntryAdded
Signal emitted when a DtSimObjectEntry is added.
Definition: DtSimData.h:89
DtStateViewCollection(DtDe &de, DtSimEntryUpdater::UpdateRate rate)
CTOR. Connects to DtSimData for signals about DtSimObjectEntry and DtSimState changes. Sets the update rate of all the DtStateViews created.
Definition: DtStateViewCollection.h:98
bool isCompatible(DtSimObjectEntry &entry)
Returns true if the DtSimEntry contains a state of type T.
Definition: DtStateViewCollection.h:196
boost::signalslib::signal< void(const DtStateView< T > &)> signal_stateViewAdded
Signal emitted when a DtStateView is added.
Definition: DtStateViewCollection.h:60
Base class to provide boost signal/slot management.
DtDe & myDe
Definition: DtStateViewCollection.h:90
boost::signalslib::signal< void(DtSimObjectEntry &, DtSimState &)> signal_simStateAdded
Signal emitted when a DtSimState is added to a DtSimEntry.
Definition: DtSimData.h:95
boost::signalslib::signal< void(DtSimObjectEntry &, DtSimState &)> signal_simStateToBeRemoved
Signal emitted when a DtSimEntry is about to be removed from a DtSimObjectEntry.
Definition: DtSimData.h:99
A DtSimState is the base class for all state objects. Derived instances of DtSimState will be created...
Definition: DtSimState.h:19
Contains makVrv::DtUniqueID type.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
std::map< DtUniqueID, DtStateView< T > * > StateViewMap
Map of unique id's to DtStateViews's.
Definition: DtStateViewCollection.h:33
DtSimData & simData()
Get simulation data. DtSimData contains simulation-specific state data.
Contains makVrv::DtDataBank class.
StateViewMap myStateViewMap
Definition: DtStateViewCollection.h:91
static bool isCompatible(DtSimEntry &entry)
Returns true if the DtSimEntry contains a state of type T.
Definition: DtStateView.h:150
void manageConnection(const boost::signalslib::connection &conn)
Connect a signal.
boost::signalslib::signal< void(DtSimObjectEntry &)> signal_simObjectEntryToBeRemoved
Signal emitted when a DtSimObjectEntry is about to be removed.
Definition: DtSimData.h:92
void populateFromExistingEntries()
Go through existing DtSimEntry's and populate this container.
Definition: DtStateViewCollection.h:214
size_t size() const
Return the number of the objects in the container.
Definition: DtStateViewCollection.h:208
void setUpdateRate(DtSimEntryUpdater::UpdateRate rate)
Set the rate this view will be updated with state information.
Definition: DtStateView.h:138
Contains DLL export macros.