VR-Vantage API Documentation
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;
47  typedef std::vector<DtElementAttribute*> AttributeList;
48  typedef std::pair<DtElementEntry*,AttributeList> EntryAttributes;
49  typedef std::vector<EntryAttributes> EntryAttributesList;
51 
53  DtElementData(DtDe& de);
54 
56  ~DtElementData();
57 
59  void applyChanges(const DtElementChanges& changes);
60 
62  const ElementEntryMap& elements() const;
63 
65  const ElementToSceneObjectMap& elementToSceneObjectMap() const;
66 
68  DtElementEntry* findElement(DtElementID id );
69 
72  void findAll(DtElementEntry::ElementType type,
73  ElementList& outVector, bool sort = true);
74 
77  void findAll(const std::vector<DtElementEntry::ElementType>& types,
78  ElementList& outVector, bool sort = true);
79 
82  void findAll(ElementList& outVector, bool sort = true);
83 
84 
87  virtual void addElementID( const DtElementID& elementID,
88  const DtUniqueID& sceneObjectID, int modelSet );
89 
93  virtual void addElementID( const DtElementID& elementID,
94  const DtUniqueID& sceneObjectID );
95 
97  virtual void removeElementID( const DtElementID& elementID,
98  const DtUniqueID& sceneObjectID, int modelSet );
99 
100  virtual void removeElementID( const DtElementID& elementID,
101  const DtUniqueID& sceneObjectID);
102 
106  virtual void getSceneObjectIds( const DtElementID& elementID,
107  SceneObjectIdList& outputList,
108  int modelSet = -1 /* all modelSets */ ) const;
109 
111  virtual DtElementID elementId( const DtUniqueID& sceneObjectID ) const;
112 
113 
115  boost::signal< void (const ElementList&) > signal_elementsAdded;
116 
118  boost::signal< void (const UniqueIdList&) > signal_elementsToBeRemoved;
119 
121  boost::signal< void (const EntryAttributesList&) > signal_attributesChanged;
122 
123  protected:
124 
125  typedef boost::unordered_map<int, ElementToSceneObjectMap>
127  typedef boost::unordered_map<DtUniqueID, DtElementID>
129 
132 
133  // map to go from element ID to scene object IDs
135 
136  // map to go from element ID and model set to scene object id(s)
138 
139  // map to go from scene object id to element id
141 
142  };
143 }


Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)