-
Notifications
You must be signed in to change notification settings - Fork 0
/
FeatureCategorisation.h
96 lines (86 loc) · 2.33 KB
/
FeatureCategorisation.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#pragma once
#include "FeatureExtraction.h"
#include "Utilities.h"
#include "FeatureExtraction.h"
#include <memory>
using namespace Utilities;
using namespace FeatureExtractionAlgo;
namespace FeatureCategorisation
{
//public:
enum FeatureCategorisationType
{
PLANAR=0,
SPHERICAL=1,
CYLINDRICAL=2,
SWEPT=3,
COMPLEX=4 //Used for all features that cannot be categorised
};
enum EdgeCategorisationType
{
LINEAR = 0,
CIRCULAR = 1,
FREE = 2
};
//static const vector<std::string> CategoryNames = { "Planar","Spherical","Prismoidal","Swept","Complex" };
struct CategorisationData
{
};
struct EdgeCategorisationData : CategorisationData
{
EdgeCategorisationType type;
};
struct SurfaceCategorisationData : CategorisationData
{
FeatureCategorisationType type;
};
struct LinearEdgeData :EdgeCategorisationData
{
Vector3d dir;
Vector3d pos;
};
struct CircularEdgeData : EdgeCategorisationData
{
Vector3d position;
double radius;
Vector3d normal;
Vector3d p1;
Vector3d p2;
Vector3d tangent;
};
//struct ArcEdgeData : EdgeCategorisationData
//{
// Vector3d p1;
// Vector3d p2;
// Vector3d tangent;
//};
struct PlanarSurfaceData :SurfaceCategorisationData
{
Vector3d normal;
Vector3d centroid;
gp_Dir normal2;
Vector3d normal3;
};
struct SphericalSurfaceData : SurfaceCategorisationData
{
Vector3d position;
double radius;
};
struct CylindricalSurfaceData : SurfaceCategorisationData
{
Vector3d position;
Vector3d dir;
double radius;
double vMax;
double vMin;
};
class EdgeCategoryMap : public unordered_map<ExtractedFeatureEdge, shared_ptr<EdgeCategorisationData>, EdgeHash> {};
void Categorise(const ExtractedFeatures &features, EdgeCategoryMap &edgeCategoryMap, vector<shared_ptr<SurfaceCategorisationData>> &data, double tolerance = 0.1);
/*void CategoriseFeatures(FeatureExtractionAlgo::ExtractedFeatures features, vector<shared_ptr<SurfaceCategorisationData>> &data, double tolerance= 0.1);
void CategoriseEdges(const ExtractedFeatures &features, EdgeCategoryMap &edgeCategoryMap);*/
//protected:
//bool PlanarCheck(const vector<TopoDS_Face> faces, double creaseAngle);
//bool SphericalCheck(const vector<TopoDS_Vertex> vertices, double allowableError = 0.1);
//bool TubularCheck(const vector<TopoDS_Vertex> vertices, int numEdgeGroups, double allowableError = 0.1);
//private:
};