-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpattern.h
More file actions
49 lines (40 loc) · 1.39 KB
/
pattern.h
File metadata and controls
49 lines (40 loc) · 1.39 KB
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
40
41
42
43
44
45
46
47
48
49
#ifndef PATTERN_H
#define PATTERN_H
#include "global.h"
#include "jsonelement.h"
#include <opencv2/core.hpp>
#include <array>
#define NUM_COLORS (8)
#define DEFAULT_FOLD_SYMMETRY (1)
class PatternSelection;
class Pattern : public base::json::JsonObject
{
private:
static const std::array<base::Color, NUM_COLORS> color_map_;
static const std::vector<std::pair<uint, std::string>> fold_symmetries_;
std::size_t pattern_id_;
base::Color color_;
base::Path img_path_;
cv::Mat3b pattern_img_;
uint fold_symmetry_;
std::vector<PatternSelection*> pattern_selections_;
public:
Pattern(std::size_t pattern_id, const base::Path &img_path);
Pattern(const base::json::JsonObject::ptr json_obj, const base::Path &base_path);
Pattern(const Pattern &pattern);
~Pattern();
base::Color color() const;
std::string title() const;
base::Path imgPath() const;
cv::Mat3b image() const;
uint foldSymmetry() const;
const std::vector<PatternSelection*> patternSelections() const;
void addPatternSelection(PatternSelection *pattern_selection);
void removePatternSelection(const PatternSelection *pattern_selection);
void setFoldSymmetry(uint fold_symmetry);
static std::array<base::Color, NUM_COLORS> colorMap();
static std::vector<std::pair<uint, std::string>> foldSymmetries();
protected:
virtual std::string createJsonString(bool expand=false, uint indent=0) const;
};
#endif // PATTERN_H