VR-Forces 4.0.4 Class Documentation
include/vrfGuiCore/DtObjectDataInterface.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2012 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 
00008 
00010 
00011 #pragma once
00012 
00013 #include <vrfGuiCore/vrfGuiCore.h>
00014 #include <vrvCore/DtElementEntry.h>
00015 #include <vrvCore/DtEntityState.h>
00016 #include <vrvCore/DtSimEntryUpdater.h>
00017 #include <vrfGuiCore/DtVrfObjectDataState.h>
00018 #include <vrvCore/DtStateViewCollection.h>
00019 
00020 namespace makVrf
00021 {
00043    class DT_DLL_VRFGUICORE DtObjectDataInterface
00044    {
00045    public:
00047       enum Representation
00048       {
00049          Local = 0,
00050          World = 1
00051       };
00052 
00053    public:
00054       DtObjectDataInterface(makVrv::DtDe&);
00055       virtual ~DtObjectDataInterface();
00056 
00059       makVrv::DtElementID elementID() const;
00060 
00063       virtual makVrv::DtElementEntry::ElementType type() const;
00064 
00067       template<typename T_ObjectDataInterfaceType>
00068       static DtBoost::shared_ptr<T_ObjectDataInterfaceType> cast(DtBoost::shared_ptr<DtObjectDataInterface> dataInterface)
00069       {
00070          return DtBoost::dynamic_pointer_cast<T_ObjectDataInterfaceType>(dataInterface);
00071       }
00072 
00077       virtual makVrv::DtSimEntryUpdater::UpdateRate setUpdateRate(makVrv::DtSimEntryUpdater::UpdateRate);
00078 
00080       virtual void setStateView(const makVrv::DtStateView<makVrv::DtSimState>* s);
00081 
00083       makVrv::DtSimEntryUpdater::UpdateRate updateRate() const;
00084 
00086       virtual void forceUpdate();
00087 
00089       virtual bool hasBeenRemoved() const;
00090 
00092       virtual bool isVisible() const;
00093 
00097       virtual void setVisible(bool);
00098 
00100       virtual bool isSelected() const;
00101 
00103       virtual void removeFromSelection();
00104 
00106       virtual void addToSelection(bool replace = false);
00107 
00108    public:
00110       boost::signal<void ()> signal_dataUpdated;
00111 
00113       boost::signal<void ()> signal_dataRemoved;
00114 
00115    protected:
00117       virtual void slot_simObjectEntryAboutToBeRemoved(makVrv::DtSimObjectEntry&);
00118 
00120       virtual DtVector geocentricVectorToLocalVector(const DtVector& localLocation, const DtVector& geocVector) const;
00121 
00123       virtual void slot_onStateViewUpdated();
00124 
00125    protected:
00126       makVrv::DtDe& myDe;
00127       makVrv::DtStateView<makVrv::DtSimState>* myStateView;
00128    };
00129 
00130    typedef DtBoost::shared_ptr<DtObjectDataInterface> DtObjectDataInterfacePtr;
00131 
00132    class DT_DLL_VRFGUICORE DtObjectDataInterfaceCreatorInterface
00133    {
00134    public:
00135       virtual DtObjectDataInterface* create(makVrv::DtDe&) const = 0;
00136    };
00137 
00139    template <typename T>
00140    class DtObjectDataInterfaceCreator : public DtObjectDataInterfaceCreatorInterface
00141    {
00142    protected:
00143       DtObjectDataInterface* create(makVrv::DtDe& de) const { return new T(de); };
00144    };
00145 
00146    class DT_DLL_VRFGUICORE DtObjectDataInterfaceCreationFactory : public makVrv::DtVirtualBaseClass
00147    {
00148    public:
00149       DtObjectDataInterfaceCreationFactory(makVrv::DtDe&);
00150       virtual ~DtObjectDataInterfaceCreationFactory();
00151 
00153       static DtObjectDataInterfaceCreationFactory& instance(makVrv::DtDe&);
00154 
00156       static void registerInstance(makVrv::DtDe& de, DtObjectDataInterfaceCreationFactory* instance);
00157 
00159       void addNetworkDataInterfaceCreator(makVrv::DtElementEntry::ElementType, DtObjectDataInterfaceCreatorInterface*);
00160 
00161       virtual DtObjectDataInterface* createNetworkDataInterface(makVrv::DtElementEntry::ElementType);
00162 
00163    protected:
00164       typedef std::map<int, DtObjectDataInterfaceCreatorInterface*> DataCreatorMap;
00165 
00166       DataCreatorMap myDataCreatorMap;
00167       makVrv::DtDe& myDe;
00168    };
00169 }

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)