-
Notifications
You must be signed in to change notification settings - Fork 0
/
octree_visitor_face.h
96 lines (78 loc) · 2.61 KB
/
octree_visitor_face.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
// Author: Justin Kinney
// Date: Sep 2008
#ifndef OCTREE_VISITOR_FACE_H
#define OCTREE_VISITOR_FACE_H
#include "meshmorph.h"
#include "face.h"
#include "Octree.h"
#include <iostream>
using hxa7241_graphics::OctreeVisitor;
using hxa7241_graphics::Vector3r;
using hxa7241_graphics::OctreeCell;
using hxa7241_graphics::OctreeData;
using hxa7241_graphics::Array;
using hxa7241_graphics::OctreeRoot;
using hxa7241_graphics::dword;
using hxa7241_graphics::OctreeBranch;
class Octree_Visitor_Face
: public OctreeVisitor<Face>
{
/// standard object services ---------------------------------------------------
public:
Octree_Visitor_Face(Vector3r,Vector3r);
virtual ~Octree_Visitor_Face();
//void print (void)
//{
// for (fp_it i=matches.begin();i!=matches.end();i++)
// {
// (*i)->print(std::cout);
// }
//}
fp_it mybegin (void)
{
return matches.begin();
}
fp_it myend (void)
{
return matches.end();
}
// void sort (void)
// {
// std::sort(matches.begin(),matches.end());
// matches.assign(matches.begin(),unique(matches.begin(),matches.end()));
// }
int num_faces (void)
{
return matches.size();
}
int num_leaves (void)
{
return leaves_visited;
}
// virtual void dump_(std::string const &indent);
// void dump_node(std::string const &indent);
// void dump_leaf(std::string const &indent);
private:
Octree_Visitor_Face( const Octree_Visitor_Face& );
Octree_Visitor_Face& operator=( const Octree_Visitor_Face& );
/// commands -------------------------------------------------------------------
/// octree visitor overrides
protected:
virtual void visitRoot ( const OctreeCell* pRootCell,
const OctreeData& octreeData );
virtual void visitBranch( const OctreeCell* subCells[8],
const OctreeData& octreeData );
virtual void visitLeaf ( const Array<const Face*>& items,
const OctreeData& octreeData );
// any other commands ...
/// queries --------------------------------------------------------------------
// any queries ...
/// fields ---------------------------------------------------------------------
private:
Vector3r * mylower;
Vector3r * myupper;
// hashset_fp matches;
vec_fp matches;
int leaves_visited;
};
#endif