Last change
on this file since 825 was
825,
checked in by vrinside, 15 years ago
|
Image Loader initialization
Point Renderer code added..
- Put a data container and manage the containters with std::vector
- Renderer
1) scale factor part should be taken into account
|
File size:
785 bytes
|
Line | |
---|
1 | #include "PointSet.h" |
---|
2 | #include "PCASplit.h" |
---|
3 | #include <stdlib.h> |
---|
4 | |
---|
5 | PointSet::PointSet() |
---|
6 | : _visible(false), _cluster(0), _sortLevel(4) |
---|
7 | { |
---|
8 | } |
---|
9 | |
---|
10 | PointSet::~PointSet() |
---|
11 | { |
---|
12 | if (_cluster) |
---|
13 | { |
---|
14 | delete _cluster; |
---|
15 | } |
---|
16 | } |
---|
17 | |
---|
18 | void PointSet::initialize(Vector4* values, const unsigned int count) |
---|
19 | { |
---|
20 | PCA::PCASplit pcaSplit; |
---|
21 | |
---|
22 | PCA::Point* points = (PCA::Point*) malloc(sizeof(PCA::Point) * count); |
---|
23 | for (unsigned int i = 0; i < count; ++i) |
---|
24 | { |
---|
25 | points[i].position.set(values[i].x, values[i].y, values[i].z); |
---|
26 | |
---|
27 | // TBD |
---|
28 | points[i].color.set(1.0f, 1.0f, 1.0f, 0.2f); |
---|
29 | |
---|
30 | points[i].value = values[i].w; |
---|
31 | } |
---|
32 | |
---|
33 | if (_cluster != 0) |
---|
34 | { |
---|
35 | delete _cluster; |
---|
36 | } |
---|
37 | |
---|
38 | |
---|
39 | _cluster = pcaSplit.doIt(points, count); |
---|
40 | } |
---|
41 | |
---|
42 | void PointSet::updateColor() |
---|
43 | { |
---|
44 | |
---|
45 | } |
---|
46 | |
---|
Note: See
TracBrowser
for help on using the repository browser.