source: trunk/vizservers/nanovis/PointSet.cpp @ 825

Last change on this file since 825 was 825, checked in by vrinside, 14 years ago

Image Loader initialization

  • Add BMP loader in Nv.cpp

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
5PointSet::PointSet()
6: _visible(false), _cluster(0), _sortLevel(4)
7{
8}
9
10PointSet::~PointSet()
11{
12    if (_cluster)
13    {
14        delete _cluster;
15    }
16}
17
18void 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
42void PointSet::updateColor()
43{
44   
45}
46
Note: See TracBrowser for help on using the repository browser.