OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
QuadtreeNode.h
Go to the documentation of this file.
1#ifndef QUADTREENODE_H
2#define QUADTREENODE_H
3
4#include <vector>
5#include <memory>
6#include <BRepBuilderAPI_MakeFace.hxx>
7#include <BRepAlgoAPI_Fuse.hxx>
8
10public:
11 QuadtreeNode(double x, double y, double width, double height);
12
13 void insert(BRepBuilderAPI_MakeFace& face);
14 TopoDS_Shape fuse();
15
16private:
17 bool contains(BRepBuilderAPI_MakeFace& face);
18 void subdivide();
19 bool intersects(double qx, double qy, double qwidth, double qheight);
20 bool contains_in_query(BRepBuilderAPI_MakeFace& face, double qx, double qy, double qwidth, double qheight);
21
22 std::vector<BRepBuilderAPI_MakeFace> faces;
23 std::vector<std::shared_ptr<QuadtreeNode>> children;
24 double x, y, width, height;
25 bool divided = false;
26 static const int max_faces;
27 static const double min_size;
28};
29
30#endif // QUADTREENODE_H
Definition QuadtreeNode.h:9
QuadtreeNode(double x, double y, double width, double height)
Definition QuadtreeNode.cpp:8
void insert(BRepBuilderAPI_MakeFace &face)
Definition QuadtreeNode.cpp:11
TopoDS_Shape fuse()
Definition QuadtreeNode.cpp:45