LEFT | RIGHT |
1 /* all code originally contributed by Tao Ju */ | 1 /* |
2 /* modifications by Nicholas Bishop */ | 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
| 3 * |
| 4 * This program is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU General Public License |
| 6 * as published by the Free Software Foundation; either version 2 |
| 7 * of the License, or (at your option) any later version. |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software Foundation, |
| 16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 * |
| 18 * Contributor(s): Tao Ju |
| 19 * |
| 20 * ***** END GPL LICENSE BLOCK ***** |
| 21 */ |
3 | 22 |
4 #ifndef CUBES_H | 23 #ifndef CUBES_H |
5 #define CUBES_H | 24 #define CUBES_H |
6 | 25 |
7 #include "marching_cubes_table.h" | 26 #include "marching_cubes_table.h" |
8 | 27 |
9 /* simple wrapper for auto-generated marching cubes data */ | 28 /* simple wrapper for auto-generated marching cubes data */ |
10 class Cubes | 29 class Cubes |
11 { | 30 { |
12 public: | 31 public: |
13 /// Get number of triangles | 32 /// Get number of triangles |
14 int getNumTriangle(int mask) | 33 int getNumTriangle(int mask) |
15 { | 34 { |
16 return marching_cubes_numtri[mask]; | 35 return marching_cubes_numtri[mask]; |
17 } | 36 } |
18 | 37 |
19 /// Get a triangle | 38 /// Get a triangle |
20 void getTriangle(int mask, int index, int indices[3] ) | 39 void getTriangle(int mask, int index, int indices[3] ) |
21 { | 40 { |
22 for(int i = 0; i < 3; i++) | 41 for(int i = 0; i < 3; i++) |
23 indices[i] = marching_cubes_tris[mask][index][i]; | 42 indices[i] = marching_cubes_tris[mask][index][i]; |
24 } | 43 } |
25 }; | 44 }; |
26 | 45 |
27 #endif | 46 #endif |
LEFT | RIGHT |