BSPTree.h
1 /**************************************************************************\
2  *
3  * FILE: BSPTree.h
4  *
5  * This source file is part of DIME.
6  * Copyright (C) 1998-1999 by Systems In Motion. All rights reserved.
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License, version 2, as
10  * published by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License (the accompanying file named COPYING) for more
16  * details.
17  *
18  **************************************************************************
19  *
20  * If you need DIME for a non-GPL project, contact Systems In Motion
21  * to acquire a Professional Edition License:
22  *
23  * Systems In Motion http://www.sim.no/
24  * Prof. Brochs gate 6 sales@sim.no
25  * N-7030 Trondheim Voice: +47 22114160
26  * NORWAY Fax: +47 67172912
27  *
28 \**************************************************************************/
29 
30 #ifndef DIME_BSPTREE_H
31 #define DIME_BSPTREE_H
32 
33 #include <dime/Basic.h>
34 #include <dime/util/Array.h>
35 #include <dime/util/Linear.h>
36 
37 class dimeBox;
38 class dime_bspnode;
39 
40 class DIME_DLL_API dimeBSPTree
41 {
42 public:
43  dimeBSPTree(const int maxnodepts = 64, const int initsize = 4);
44  ~dimeBSPTree();
45 
46  int numPoints() const;
47  void getPoint(const int idx, dimeVec3f &pt);
48  void *getUserData(const int idx) const;
49 
50  void setUserData(const int idx, void * const data);
51 
52  int addPoint(const dimeVec3f &pt, void * const userdata = NULL);
53  int removePoint(const dimeVec3f &pt);
54  void removePoint(const int idx);
55  int findPoint(const dimeVec3f &pos) const;
56  void clear(const int initsize = 4);
57 
58  const dimeBox *getBBox() const;
59 
60 private:
61  friend class dime_bspnode;
62  dimeArray <dimeVec3f> pointsArray;
63  dimeArray <void*> userdataArray;
64  dime_bspnode *topnode;
65  int maxnodepoints;
66  dimeBox *boundingBox;
67 }; // class dimeBSPTree
68 
69 #endif // ! DIME_BSPTREE_H
70 

Copyright © 1998-1999, Systems In Motion <sales@sim.no>. All rights reserved.
System documentation was generated using doxygen.