VR-Forces 4.3.1 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/vrvCore.h>
15 #include <vrvCore/DtUniqueID.h>
16 #include <vrvCore/DtElementEntry.h>
17 
18 #include <boost/signals.hpp>
19 #include <boost/unordered_map.hpp>
20 
21 namespace makVrv
22 {
23  class DtElementChanges;
24  class DtElementEntry;
25  class DtElementAttribute;
26  class DtDe;
27 
32  {
33  public:
34 
35  //A list of scene object Ids.
36  typedef std::vector<DtUniqueID> SceneObjectIdList;
37 
39  typedef boost::unordered_map<DtElementID, DtElementEntry*> ElementEntryMap;
40  typedef boost::unordered_map<DtElementID, SceneObjectIdList>
42 
44 
45  typedef std::vector<DtElementEntry*> ElementList;
46  typedef std::vector<DtElementID> UniqueIdList; // deprecated
47  typedef std::vector<DtElementID> ElementIdList;
48  typedef std::vector<DtElementAttribute*> AttributeList;
49  typedef std::pair<DtElementEntry*,AttributeList> EntryAttributes;
50  typedef std::vector<EntryAttributes> EntryAttributesList;
52 
54  DtElementData(DtDe& de);
55 
57  virtual ~DtElementData();
58 
60  void applyChanges(const DtElementChanges& changes);
61 
63  const ElementEntryMap& elements() const;
64 
66  const ElementToSceneObjectMap& elementToSceneObjectMap() const;
67 
69  DtElementEntry* findElement(DtElementID id );
70 
73  void findAll(DtElementEntry::ElementType type,
74  ElementList& outVector, bool sort = true);
75 
78  void findAll(const std::vector<DtElementEntry::ElementType>& types,
79  ElementList& outVector, bool sort = true);
80 
83  void findAll(ElementList& outVector, bool sort = true);
84 
85 
88  virtual void addElementID( const DtElementID& elementID,
89  const DtUniqueID& sceneObjectID, int modelSet );
90 
94  virtual void addElementID( const DtElementID& elementID,
95  const DtUniqueID& sceneObjectID );
96 
98  virtual void removeElementID( const DtElementID& elementID,
99  const DtUniqueID& sceneObjectID, int modelSet );
100 
101  virtual void removeElementID( const DtElementID& elementID,
102  const DtUniqueID& sceneObjectID);
103 
107  virtual void getSceneObjectIds( const DtElementID& elementID,
108  SceneObjectIdList& outputList,
109  int modelSet = -1 /* all modelSets */ ) const;
110 
112  virtual DtElementID elementId( const DtUniqueID& sceneObjectID ) const;
113 
114 
116  boost::signal< void (const ElementList&) > signal_elementsAdded;
117 
124  boost::signal< void (const ElementIdList&) > signal_elementsInitialized;
125 
127  boost::signal< void (const ElementIdList&) > signal_elementsToBeRemoved;
128 
130  boost::signal< void (const EntryAttributesList&) > signal_attributesChanged;
131 
132  protected:
133 
135  virtual void slot_preTick();
136 
137  protected:
138 
139  typedef boost::unordered_map<int, ElementToSceneObjectMap>
141  typedef boost::unordered_map<DtUniqueID, DtElementID>
143 
146 
147  // map to go from element ID to scene object IDs
149 
150  // map to go from element ID and model set to scene object id(s)
152 
153  // map to go from scene object id to element id
155 
157 
158  };
159 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)