Overte C++ Documentation
AssignmentParentFinder.h
1 //
2 // AssignmentParentFinder.h
3 // interface/src/entities
4 //
5 // Created by Seth Alves on 2015-10-21
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_AssignmentParentFinder_h
13 #define hifi_AssignmentParentFinder_h
14 
15 #include <memory>
16 #include <QUuid>
17 
18 #include <EntityTree.h>
19 #include <SpatialParentFinder.h>
20 
21 // This interface is used to turn a QUuid into a pointer to a "parent" -- something that children can
22 // be spatially relative to. At this point, this means either an EntityItem or an Avatar.
23 
24 class AssignmentParentFinder : public SpatialParentFinder {
25 public:
26  AssignmentParentFinder(EntityTreePointer tree) : _tree(tree) { }
27  virtual ~AssignmentParentFinder() { }
28  virtual SpatiallyNestableWeakPointer find(QUuid parentID, bool& success,
29  SpatialParentTree* entityTree = nullptr) const override;
30 
31 protected:
32  EntityTreePointer _tree;
33 };
34 
35 #endif // hifi_AssignmentParentFinder_h