VR-Forces 4.0.4 Class Documentation
include/vrfGuiCore/DtGlobalIdToElementIdMapper.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2010 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 /******************************************************************************
00006 ** $RCSfile: DtGlobalIdToElementIdMapper.h,v $ $Revision: 1.1 $ $State: Exp $
00007 ******************************************************************************/
00008 
00011 
00013 
00014 #pragma once
00015 
00016 #include <vrfGuiCore/vrfGuiCore.h>
00017 
00018 #include <vrvUtil/DtVirtualBaseClass.h>
00019 #include <vrvCore/DtUniqueID.h>
00020 #include <vrvCore/DtSimState.h>
00021 #include <vrvCore/DtStateView.h>
00022 #include <vrvCore/DtEntityState.h>
00023 
00024 #include <boost/unordered_map.hpp>
00025 
00026 namespace makVrv
00027 {
00028    class DtDe;
00029    class DtBaseStateView;
00030    class DtSimEntry;
00031    class DtSimObjectEntry;
00032 }
00033 
00034 namespace makVrf
00035 {
00037    class DT_DLL_VRFGUICORE DtGlobalIdToElementIdMapper : public makVrv::DtVirtualBaseClass
00038    {
00039    protected:
00040       typedef boost::unordered_map<makVrv::DtElementID, std::string> ElementIdToGlobalIdMap;
00041       typedef boost::unordered_map<std::string, makVrv::DtElementID> GlobalIdToElementIdMap;
00042 
00043    public:
00044       DtGlobalIdToElementIdMapper(makVrv::DtDe&);
00045       virtual ~DtGlobalIdToElementIdMapper();
00046 
00048       static DtGlobalIdToElementIdMapper& instance(makVrv::DtDe& de);
00049 
00050       static void registerInstance(makVrv::DtDe& de, DtGlobalIdToElementIdMapper*);
00051 
00052    public:
00053 
00054       makVrv::DtElementID globalIdToElementId(const std::string&) const;
00055       std::string elementIdToGlobalId(makVrv::DtElementID) const;
00056 
00057       makVrv::DtElementID entityIdToElementId(const std::string&) const;
00058       std::string elementIdToEntityId(makVrv::DtElementID) const;
00059 
00060    protected:
00061       virtual void slot_simStateAdded(makVrv::DtSimObjectEntry&);
00062       virtual void slot_simStateAboutToBeRemoved(makVrv::DtSimObjectEntry&);
00063       virtual void slot_stateViewUpdated(makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>* s);
00064 
00065       virtual void eraseFrom(ElementIdToGlobalIdMap&, GlobalIdToElementIdMap&, makVrv::DtElementID);
00066 
00067    protected:
00068       virtual void initialize();
00069 
00070    protected:
00071       ElementIdToGlobalIdMap myElementIdToGlobalIdMap;
00072       GlobalIdToElementIdMap myGlobalIdToElementIdMap;
00073 
00074       ElementIdToGlobalIdMap myElementIdToEntityIdMap;
00075       GlobalIdToElementIdMap myEntityIdToElementIdMap;
00076 
00077       makVrv::DtDe&  myDe;
00078    };
00079 }

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)