VR-Forces 4.2 Class Documentation
DtObjectDataInterface.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include <vrfGuiCore/vrfGuiCore.h>
14 #include <vrvCore/DtElementEntry.h>
15 #include <vrvCore/DtEntityState.h>
16 #include <vrvCore/DtSimEntryUpdater.h>
18 #include <vrvCore/DtStateViewCollection.h>
19 
20 namespace makVrf
21 {
44  {
45  public:
48  {
49  Local = 0,
50  World = 1
51  };
52 
53  public:
54  DtObjectDataInterface(makVrv::DtDe&);
55  virtual ~DtObjectDataInterface();
56 
59  makVrv::DtElementID elementID() const;
60 
63  virtual makVrv::DtElementEntry::ElementType type() const;
64 
67  template<typename T_ObjectDataInterfaceType>
68  static DtBoost::shared_ptr<T_ObjectDataInterfaceType> cast(DtBoost::shared_ptr<DtObjectDataInterface> dataInterface)
69  {
70  return DtBoost::dynamic_pointer_cast<T_ObjectDataInterfaceType>(dataInterface);
71  }
72 
77  virtual makVrv::DtSimEntryUpdater::UpdateRate setUpdateRate(makVrv::DtSimEntryUpdater::UpdateRate);
78 
80  virtual void setStateView(const makVrv::DtStateView<makVrv::DtSimState>* s);
81 
83  makVrv::DtSimEntryUpdater::UpdateRate updateRate() const;
84 
86  virtual void forceUpdate();
87 
89  virtual bool isValid() const;
90 
92  virtual bool hasBeenRemoved() const;
93 
95  virtual bool isVisible() const;
96 
100  virtual void setVisible(bool);
101 
103  virtual bool isSelected() const;
104 
106  virtual void removeFromSelection();
107 
109  virtual void addToSelection(bool replace = false);
110 
111  public:
113  boost::signal<void ()> signal_dataUpdated;
114 
116  boost::signal<void ()> signal_dataRemoved;
117 
118  protected:
120  virtual void slot_simObjectEntryAboutToBeRemoved(makVrv::DtSimObjectEntry&);
121 
123  virtual DtVector geocentricVectorToLocalVector(const DtVector& localLocation, const DtVector& geocVector) const;
124 
126  virtual void slot_onStateViewUpdated();
127 
128  protected:
129  makVrv::DtDe& myDe;
130  makVrv::DtStateView<makVrv::DtSimState>* myStateView;
131  };
132 
133  typedef DtBoost::shared_ptr<DtObjectDataInterface> DtObjectDataInterfacePtr;
134 
136  {
137  public:
138  virtual DtObjectDataInterface* create(makVrv::DtDe&) const = 0;
139  };
140 
142  template <typename T>
144  {
145  protected:
146  DtObjectDataInterface* create(makVrv::DtDe& de) const { return new T(de); };
147  };
148 
149  class DT_DLL_VRFGUICORE DtObjectDataInterfaceCreationFactory : public makVrv::DtVirtualBaseClass
150  {
151  public:
154 
156  static DtObjectDataInterfaceCreationFactory& instance(makVrv::DtDe&);
157 
159  static void registerInstance(makVrv::DtDe& de, DtObjectDataInterfaceCreationFactory* instance);
160 
162  void addNetworkDataInterfaceCreator(makVrv::DtElementEntry::ElementType, DtObjectDataInterfaceCreatorInterface*);
163 
164  virtual DtObjectDataInterface* createNetworkDataInterface(makVrv::DtElementEntry::ElementType);
165 
166  protected:
167  typedef std::map<int, DtObjectDataInterfaceCreatorInterface*> DataCreatorMap;
168 
170  makVrv::DtDe& myDe;
171  };
172 }

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)