source: GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/gfx/geom/ProxGrid.h @ 1025

Revision 1025, 893 bytes checked in by gumbau, 18 years ago (diff)

namespace simplif

Line 
1#ifndef GFXGEOM_PROXGRID_INCLUDED // -*- C++ -*-
2#define GFXGEOM_PROXGRID_INCLUDED
3
4#include <gfx/math/Vec3.h>
5#include <gfx/tools/Buffer.h>
6#include <gfx/tools/Array3.h>
7
8
9namespace simplif
10{
11        class ProxGrid_Cell : public buffer<Vec3 *>
12        {
13
14        public:
15
16                ProxGrid_Cell()
17                : buffer<Vec3 *>(8)
18                { }
19        };
20
21
22
23
24
25        class ProxGrid
26        {
27                array3<ProxGrid_Cell> cells;
28                int xdiv, ydiv, zdiv;
29                real cellsize;
30                real cellsize2;
31
32                Vec3 min, max;
33
34                void cell_for_point(const Vec3&, int *i, int *j, int *k);
35                void maybe_collect_points(Vec3 *v, buffer<Vec3 *>& close,
36                                          ProxGrid_Cell& cell);
37
38        public:
39
40                ProxGrid(const Vec3& min, const Vec3& max, real dist);
41                ~ProxGrid() { cells.free(); }
42
43                void addPoint(Vec3 *);
44                void removePoint(Vec3 *);
45                void proximalPoints(Vec3 *, buffer<Vec3 *>&);
46
47        };
48}
49
50
51
52
53
54
55
56// GFXGEOM_PROXGRID_INCLUDED
57#endif
Note: See TracBrowser for help on using the repository browser.