Introduucing the tag to the scene

This commit is contained in:
samcake 2017-04-05 18:35:06 -07:00
parent 8267db6ce5
commit 3de760abcb
3 changed files with 82 additions and 0 deletions

View file

@ -14,6 +14,7 @@
#include "Item.h"
#include "SpatialTree.h"
#include "Tag.h"
namespace render {
@ -114,6 +115,11 @@ protected:
void removeItems(const ItemIDs& ids);
void updateItems(const ItemIDs& ids, UpdateFunctors& functors);
// The Tag map
std::mutex _tagsMutex;
TagMap _tags;
friend class Engine;
};

View file

@ -0,0 +1,27 @@
//
// Tag.cpp
// render/src/render
//
// Created by Sam Gateau on 4/4/2017.
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "Tag.h"
#include "Logging.h"
using namespace render;
Tag::Tag(const std::string& name, const ItemIDs items) :
_name(name),
_items(items)
{
}
Tag::~Tag() {
}

View file

@ -0,0 +1,49 @@
//
// Tag.h
// render/src/render
//
// Created by Sam Gateau on 4/4/2017.
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_render_Tag_h
#define hifi_render_Tag_h
#include "Item.h"
namespace render {
class Tag {
public:
Tag(const std::string& name, const ItemIDs items);
~Tag();
const std::string& getName() const { return _name; }
const ItemIDs& getItems() const { return _items; }
protected:
const std::string _name;
ItemIDs _items;
};
using Tags = std::vector<Tag>;
class TagMap {
public:
using NameMap = std::map<std::string, uint32_t>;
TagMap() {}
~TagMap() {}
protected:
NameMap _names;
Tags _values;
};
}
#endif