/
MaterialPopulator.h
39 lines (27 loc) · 1.08 KB
/
MaterialPopulator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include <set>
#include "wxutil/dataview/ThreadedDeclarationTreePopulator.h"
#include "MaterialTreeView.h"
namespace ui
{
class MaterialPopulator :
public wxutil::ThreadedDeclarationTreePopulator
{
private:
const MaterialTreeView::TreeColumns& _columns;
// The set of favourites
std::set<std::string> _favourites;
public:
// Construct and initialise variables
MaterialPopulator(const MaterialTreeView::TreeColumns& columns);
virtual ~MaterialPopulator();
// Add the given named material to the tree (assuming it was not present before)
void AddSingleMaterial(const wxutil::TreeModel::Ptr& model, const std::string& materialName);
// Remove the given named material from the tree (assuming it is present)
void RemoveSingleMaterial(const wxutil::TreeModel::Ptr& model, const std::string& materialName);
protected:
virtual void PopulateModel(const wxutil::TreeModel::Ptr& model) override;
// Special sort algorithm to sort the "Other Materials" separately
virtual void SortModel(const wxutil::TreeModel::Ptr& model) override;
};
}