Overte C++ Documentation
SpatialParentFinder.h
1 //
2 // SpatialParentFinder.h
3 // libraries/shared/src/
4 //
5 // Created by Seth Alves on 2015-10-18
6 // Copyright 2015 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_SpatialParentFinder_h
13 #define hifi_SpatialParentFinder_h
14 
15 #include <QUuid>
16 
17 #include "DependencyManager.h"
18 
19 class SpatiallyNestable;
20 using SpatiallyNestableWeakPointer = std::weak_ptr<SpatiallyNestable>;
21 using SpatiallyNestablePointer = std::shared_ptr<SpatiallyNestable>;
22 class SpatialParentTree {
23 public:
24  virtual SpatiallyNestablePointer findByID(const QUuid& id) const = 0;
25 };
26 class SpatialParentFinder : public Dependency {
27 
28 
29 
30 // This interface is used to turn a QUuid into a pointer to a "parent" -- something that children can
31 // be spatially relative to. At this point, this means either an EntityItem or an Avatar.
32 
33 
34 public:
35  SpatialParentFinder() { }
36  virtual ~SpatialParentFinder() { }
37 
38  virtual SpatiallyNestableWeakPointer find(QUuid parentID, bool& success, SpatialParentTree* entityTree = nullptr) const = 0;
39 };
40 
41 #endif // hifi_SpatialParentFinder_h