Blender  V2.93
cubes.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #ifndef __CUBES_H__
18 #define __CUBES_H__
19 
20 #include "marching_cubes_table.h"
21 
22 /* simple wrapper for auto-generated marching cubes data */
23 class Cubes {
24  public:
27  {
29  }
30 
32  void getTriangle(int mask, int index, int indices[3])
33  {
34  for (int i = 0; i < 3; i++)
35  indices[i] = marching_cubes_tris[mask][index][i];
36  }
37 
38 #ifdef WITH_CXX_GUARDEDALLOC
39  MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:Cubes")
40 #endif
41 };
42 
43 #endif /* __CUBES_H__ */
Definition: cubes.h:23
int getNumTriangle(int mask)
Get number of triangles.
Definition: cubes.h:26
void getTriangle(int mask, int index, int indices[3])
Get a triangle.
Definition: cubes.h:32
static ushort indices[]
const int marching_cubes_tris[TOTCONF][MAX_TRIS][3]
const int marching_cubes_numtri[TOTCONF]
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)