mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 00:40:06 +02:00
Introduucing the tag to the scene
This commit is contained in:
parent
8267db6ce5
commit
3de760abcb
3 changed files with 82 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
#include "SpatialTree.h"
|
#include "SpatialTree.h"
|
||||||
|
#include "Tag.h"
|
||||||
|
|
||||||
namespace render {
|
namespace render {
|
||||||
|
|
||||||
|
@ -114,6 +115,11 @@ protected:
|
||||||
void removeItems(const ItemIDs& ids);
|
void removeItems(const ItemIDs& ids);
|
||||||
void updateItems(const ItemIDs& ids, UpdateFunctors& functors);
|
void updateItems(const ItemIDs& ids, UpdateFunctors& functors);
|
||||||
|
|
||||||
|
|
||||||
|
// The Tag map
|
||||||
|
std::mutex _tagsMutex;
|
||||||
|
TagMap _tags;
|
||||||
|
|
||||||
friend class Engine;
|
friend class Engine;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
27
libraries/render/src/render/Tag.cpp
Normal file
27
libraries/render/src/render/Tag.cpp
Normal 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() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
49
libraries/render/src/render/Tag.h
Normal file
49
libraries/render/src/render/Tag.h
Normal 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
|
Loading…
Reference in a new issue