-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroup.hh
More file actions
64 lines (44 loc) · 1.22 KB
/
Group.hh
File metadata and controls
64 lines (44 loc) · 1.22 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
50
51
52
53
54
55
56
57
58
59
60
#ifndef GROUP_HH
#define GROUP_HH
#include <vector>
// for stl template 'vector' that realizes a dynamic array
#include "Basic.hh"
using namespace std;
class Group : public Primitive
{
public:
vector<Primitive *> primitive;
Box unionPri; // isso passará a ser um vetor...
Group() : Primitive(NULL)
{};
~Group();
void Add(Primitive *prim)
{
primitive.push_back(prim);
unionPrimitives(prim);
};
//Dado o centro (pos) e o raio da sphera
// é calculado o cluster que ela vai pertencer
// Cadascluster eh envolvido por um BOX
int calcClusterSphere(Vec3f pos, float r){
}
int calcClusterTriangle(Vec3f center){
}
//Une todas as primitivas em um BOX, essa funcao dps será alterada pra criar varios boxes
//Kmeans...
void unionPrimitives(Primitive *prim){
Box b;
b = prim->CalcBounds();
unionPri.Extend(b);
/*
cout << "[" << b.min.x << "," << b.min.y << "," << b.min.z << "]" << endl;
cout << "[" << unionPri.min.x << "," << unionPri.min.y << "," << unionPri.min.z << "]" << endl << "---"<< endl;*/
};
virtual bool Intersect(Ray &ray);
virtual Vec3f GetNormal(Ray &ray)
{
cerr << "cannot call getnormal of a group !" << endl;
return Vec3f(0,0,0);
};
};
#endif