VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtElementData.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtElementData.h,v $ $Revision: 1.2 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 #include <vrvCore/DtElementEntry.h>
15 
16 #include <boost/signals.hpp>
17 #include <boost/unordered_map.hpp>
18 
19 namespace makVrv
20 {
21  class DtElementChanges;
22  class DtElementEntry;
23  class DtElementAttribute;
24  class DtDe;
25 
30  {
31  public:
32 
33  //A list of scene object Ids.
34  typedef std::vector<DtUniqueID> SceneObjectIdList;
35 
37  typedef boost::unordered_map<DtElementID, DtElementEntry*> ElementEntryMap;
38  typedef boost::unordered_map<DtElementID, SceneObjectIdList>
40 
42 
43  typedef std::vector<DtElementEntry*> ElementList;
44  typedef std::vector<DtElementID> UniqueIdList; // deprecated
45  typedef std::vector<DtElementID> ElementIdList;
46  typedef std::vector<DtElementAttribute*> AttributeList;
47  typedef std::pair<DtElementEntry*,AttributeList> EntryAttributes;
48  typedef std::vector<EntryAttributes> EntryAttributesList;
50 
52  DtElementData(DtDe& de);
53 
55  virtual ~DtElementData();
56 
58  void applyChanges(const DtElementChanges& changes);
59 
61  const ElementEntryMap& elements() const;
62 
64  const ElementToSceneObjectMap& elementToSceneObjectMap() const;
65 
67  DtElementEntry* findElement(DtElementID id );
68 
71  void findAll(DtElementEntry::ElementType type,
72  ElementList& outVector, bool sort = true);
73 
76  void findAll(const std::vector<DtElementEntry::ElementType>& types,
77  ElementList& outVector, bool sort = true);
78 
81  void findAll(ElementList& outVector, bool sort = true);
82 
83 
86  virtual void addElementID( const DtElementID& elementID,
87  const DtUniqueID& sceneObjectID, int modelSet );
88 
92  virtual void addElementID( const DtElementID& elementID,
93  const DtUniqueID& sceneObjectID );
94 
96  virtual void removeElementID( const DtElementID& elementID,
97  const DtUniqueID& sceneObjectID, int modelSet );
98 
99  virtual void removeElementID( const DtElementID& elementID,
100  const DtUniqueID& sceneObjectID);
101 
105  virtual void getSceneObjectIds( const DtElementID& elementID,
106  SceneObjectIdList& outputList,
107  int modelSet = -1 /* all modelSets */ ) const;
108 
110  virtual DtElementID elementId( const DtUniqueID& sceneObjectID ) const;
111 
112 
114  boost::signal< void (const ElementList&) > signal_elementsAdded;
115 
122  boost::signal< void (const ElementIdList&) > signal_elementsInitialized;
123 
125  boost::signal< void (const ElementIdList&) > signal_elementsToBeRemoved;
126 
128  boost::signal< void (const EntryAttributesList&) > signal_attributesChanged;
129 
130  protected:
131 
133  virtual void slot_preTick();
134 
135  protected:
136 
137  typedef boost::unordered_map<int, ElementToSceneObjectMap>
139  typedef boost::unordered_map<DtUniqueID, DtElementID>
141 
144 
145  // map to go from element ID to scene object IDs
147 
148  // map to go from element ID and model set to scene object id(s)
150 
151  // map to go from scene object id to element id
153 
155 
156  };
157 }

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)