opensurgsim
DataGroupCopier.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2012-2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_DATASTRUCTURES_DATAGROUPCOPIER_H
17 #define SURGSIM_DATASTRUCTURES_DATAGROUPCOPIER_H
18 
19 #include <array>
20 #include <memory>
21 #include <unordered_map>
22 
23 #include "SurgSim/DataStructures/NamedData.h"
24 
25 namespace SurgSim
26 {
27 namespace DataStructures
28 {
29 class DataGroup;
30 class IndexDirectory;
31 
33 typedef std::array<NamedDataCopyMap, 9> DataGroupCopyMap;
34 
38 {
39 public:
43  DataGroupCopier(const DataGroup& source, DataGroup* target);
44 
50  void copy(const DataGroup& source, DataGroup* target);
51 
52 private:
57  NamedDataCopyMap findMap(std::shared_ptr<const IndexDirectory> source,
58  std::shared_ptr<const IndexDirectory> target) const;
59 
61  DataGroupCopyMap m_map;
62 };
63 
64 }; // namespace DataStructures
65 }; // namespace SurgSim
66 
67 
68 #endif // SURGSIM_DATASTRUCTURES_DATAGROUPCOPIER_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
A collection of NamedData objects.
Definition: DataGroup.h:68
A class that assists in copying from one DataGroup to another, when assignment is not possible...
Definition: DataGroupCopier.h:37
void copy(const DataGroup &source, DataGroup *target)
Copies the NamedData entries with the same names.
Definition: DataGroupCopier.cpp:42
DataGroupCopier(const DataGroup &source, DataGroup *target)
Construct a copier.
Definition: DataGroupCopier.cpp:28