LookUp table static data moved into static class functions

This commit is contained in:
Paolo Cignoni 2005-01-25 16:55:30 +00:00
parent 4c488dd556
commit 0af38855a4
4 changed files with 3375 additions and 3089 deletions

View File

@ -25,8 +25,19 @@
//== TABLES ==================================================================
#ifndef __VCG_EMC_LOOK_UP_TABLE
#define __VCG_EMC_LOOK_UP_TABLE
int edgeTable[256]=
namespace vcg
{
namespace tri
{
class EMCLookUpTable
{
public:
static const int EdgeTable(unsigned char cubetype)
{
static const int edgeTable[256]=
{
0x0 , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c,
0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00,
@ -61,12 +72,14 @@ int edgeTable[256]=
0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c,
0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0
};
return edgeTable[cubetype];
}; // end of EdgeTable
//-----------------------------------------------------------------------------
int triTable[256][2][17] =
static int* TriTable(unsigned char cubetype, int u)
{
static int triTable[256][2][17] =
{{{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}},
@ -884,12 +897,16 @@ int triTable[256][2][17] =
{{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}}
};
return &triTable[cubetype][u][0];
}; // end of TriTable
//-----------------------------------------------------------------------------
int polyTable[8][16] =
static const int PolyTable(unsigned int cubetype, int u)
{
static const int polyTable[8][16] =
{
{-1},
{-1},
@ -900,6 +917,12 @@ int polyTable[8][16] =
{0, 1, 2, 2, 3, 4, 4, 5, 0, 0, 2, 4, -1},
{0, 1, 5, 0, 5, 6, 1, 2, 5, 4, 5, 3, 2, 3, 5, -1}
};
return polyTable[cubetype][u];
}; // end of PolyTable
//=============================================================================
}; //end of class EMCLookUpTable
}; // end of namespace tri
}; // end of namespace vcg
#endif // __VCG_EMC_LOOK_UP_TABLE

View File

@ -175,7 +175,7 @@ namespace vcg
size_t vertices_idx[12];
memset(vertices_idx, -1, 12*sizeof(size_t));
int code = edgeTable[cubetype];
int code = EMCLookUpTable::EdgeTable(cubetype);
VertexPointer vp = NULL;
if ( 1&code ) { _walker->GetXIntercept(_corners[0], _corners[1], vp); vertices_idx[ 0] = vp - &_mesh->vert[0]; }
if ( 2&code ) { _walker->GetYIntercept(_corners[1], _corners[2], vp); vertices_idx[ 1] = vp - &_mesh->vert[0]; }
@ -190,15 +190,15 @@ namespace vcg
if (1024&code ) { _walker->GetZIntercept(_corners[2], _corners[6], vp); vertices_idx[10] = vp - &_mesh->vert[0]; }
if (2048&code ) { _walker->GetZIntercept(_corners[3], _corners[7], vp); vertices_idx[11] = vp - &_mesh->vert[0]; }
unsigned int m, n, vertices_num;
unsigned int components = triTable[cubetype][1][0];
int *indices = &triTable[cubetype][1][components+1];
int m, n, vertices_num;
int components = EMCLookUpTable::TriTable(cubetype, 1)[0]; //unsigned int components = triTable[cubetype][1][0];
int *indices = &EMCLookUpTable::TriTable(cubetype, 1)[components+1]; //int *indices = &EMCLookUpTable::TriTable(cubetype, 1, components+1);
std::vector< size_t > vertices_list;
for (m=1; m<=components; m++)
{
// current sheet contains vertices_num vertices
vertices_num = triTable[cubetype][1][m];
vertices_num = EMCLookUpTable::TriTable(cubetype, 1)[m]; //vertices_num = triTable[cubetype][1][m];
// collect vertices
vertices_list.clear();
@ -213,7 +213,7 @@ namespace vcg
size_t face_idx = _mesh->face.size();
vertices_list.push_back( vertices_list[0] );
AllocatorType::AddFaces(*_mesh, (int) vertices_num);
for (unsigned int j=0; j<vertices_num; ++j, face_idx++)
for (int j=0; j<vertices_num; ++j, face_idx++)
{
_mesh->face[face_idx].V(0) = &_mesh->vert[ vertices_list[j ] ];
_mesh->face[face_idx].V(1) = &_mesh->vert[ vertices_list[j+1] ];
@ -223,13 +223,16 @@ namespace vcg
else
{
// no feature -> old marching cubes triangle table
for (int j=0; polyTable[vertices_num][j] != -1; j+=3)
for (int j=0; EMCLookUpTable::PolyTable(vertices_num, j) != -1; j+=3) //for (int j=0; polyTable[vertices_num][j] != -1; j+=3)
{
size_t face_idx = _mesh->face.size();
AllocatorType::AddFaces(*_mesh, 1);
_mesh->face[ face_idx].V(0) = &_mesh->vert[ vertices_idx[ indices[ polyTable[vertices_num][j ] ] ] ];
_mesh->face[ face_idx].V(1) = &_mesh->vert[ vertices_idx[ indices[ polyTable[vertices_num][j+1] ] ] ];
_mesh->face[ face_idx].V(2) = &_mesh->vert[ vertices_idx[ indices[ polyTable[vertices_num][j+2] ] ] ];
//_mesh->face[ face_idx].V(0) = &_mesh->vert[ vertices_idx[ indices[ polyTable[vertices_num][j ] ] ] ];
//_mesh->face[ face_idx].V(1) = &_mesh->vert[ vertices_idx[ indices[ polyTable[vertices_num][j+1] ] ] ];
//_mesh->face[ face_idx].V(2) = &_mesh->vert[ vertices_idx[ indices[ polyTable[vertices_num][j+2] ] ] ];
_mesh->face[ face_idx].V(0) = &_mesh->vert[ vertices_idx[ indices[ EMCLookUpTable::PolyTable(vertices_num, j ) ] ] ];
_mesh->face[ face_idx].V(1) = &_mesh->vert[ vertices_idx[ indices[ EMCLookUpTable::PolyTable(vertices_num, j+1) ] ] ];
_mesh->face[ face_idx].V(2) = &_mesh->vert[ vertices_idx[ indices[ EMCLookUpTable::PolyTable(vertices_num, j+2) ] ] ];
}
}
indices += vertices_num;
@ -425,7 +428,7 @@ namespace vcg
for( ; e_it!=e_end; e_it++)
{
f = &_mesh->face[e_it->face];
z = e_it->edge;
z = (int) e_it->edge;
if (vcg::face::CheckFlipEdge< FaceType >(*f, z))
{

View File

@ -139,8 +139,8 @@ namespace vcg
for (int i=0; i<8; i++)
if (_field[i]>0) cubetype += 1<<i;
_case = cases[cubetype][0];
_config = cases[cubetype][1];
_case = MCLookUpTable::Cases(cubetype, 0); //_case = cases[cubetype][0];
_config = MCLookUpTable::Cases(cubetype, 1); //_config = cases[cubetype][1];
_subconfig = 0;
VertexPointer v12 = NULL;
@ -148,197 +148,230 @@ namespace vcg
switch( _case )
{
case 0 : { break ; }
case 1 : { AddTriangles( tiling1[_config], 1 ); break; }
case 2 : { AddTriangles( tiling2[_config], 2 ); break; }
case 1 : { AddTriangles( MCLookUpTable::Tiling1(_config), 1 ); break; } //case 1 : { AddTriangles( tiling1[_config], 1 ); break; }
case 2 : { AddTriangles( MCLookUpTable::Tiling2(_config), 2 ); break; } //case 2 : { AddTriangles( tiling2[_config], 2 ); break; }
case 3 :
{
if( TestFace( test3[_config]) ) AddTriangles( tiling3_2[_config], 4 ) ; // 3.2
else AddTriangles( tiling3_1[_config], 2 ) ; // 3.1
//if( TestFace( test3[_config]) ) AddTriangles( tiling3_2[_config], 4 ) ; // 3.2
if( TestFace( MCLookUpTable::Test3(_config)) )
AddTriangles( MCLookUpTable::Tiling3_2(_config), 4 ) ; // 3.2
else
AddTriangles( MCLookUpTable::Tiling3_1(_config), 2 ) ; // 3.1
break ;
}
case 4 :
{
if( TestInterior( test4[_config]) ) AddTriangles( tiling4_1[_config], 2 ) ; // 4.1.1
else AddTriangles( tiling4_2[_config], 6 ) ; // 4.1.2
//if( TestInterior( test4[_config]) ) AddTriangles( tiling4_1[_config], 2 ) ; // 4.1.1
if( TestInterior( MCLookUpTable::Test4(_config) ) )
AddTriangles( MCLookUpTable::Tiling4_1(_config), 2 ) ; // 4.1.1
else
AddTriangles( MCLookUpTable::Tiling4_2(_config), 6 ) ; // 4.1.2
break ;
}
case 5 : { AddTriangles( tiling5[_config], 3 ); break; }
case 5 : { AddTriangles( MCLookUpTable::Tiling5(_config), 3 ); break; }
case 6 :
{
if( TestFace( test6[_config][0]) )
AddTriangles( tiling6_2[_config], 5 ) ; // 6.2
//if( TestFace( test6[_config][0]) )
if( TestFace( MCLookUpTable::Test6(_config, 0)) )
AddTriangles( MCLookUpTable::Tiling6_2(_config), 5 ) ; // 6.2
else
{
if( TestInterior( test6[_config][1]) ) AddTriangles( tiling6_1_1[_config], 3 ) ; // 6.1.1
else AddTriangles( tiling6_1_2[_config], 7 ) ; // 6.1.2
if( TestInterior( MCLookUpTable::Test6(_config, 1)) )
AddTriangles( MCLookUpTable::Tiling6_1_1(_config), 3 ) ; // 6.1.1
else
AddTriangles( MCLookUpTable::Tiling6_1_2(_config), 7 ) ; // 6.1.2
}
break ;
}
case 7 :
{
if( TestFace( test7[_config][0] ) ) _subconfig += 1 ;
if( TestFace( test7[_config][1] ) ) _subconfig += 2 ;
if( TestFace( test7[_config][2] ) ) _subconfig += 4 ;
//if( TestFace( test7[_config][0] ) ) _subconfig += 1 ;
//if( TestFace( test7[_config][1] ) ) _subconfig += 2 ;
//if( TestFace( test7[_config][2] ) ) _subconfig += 4 ;
if( TestFace( MCLookUpTable::Test7(_config, 0) ) ) _subconfig += 1 ;
if( TestFace( MCLookUpTable::Test7(_config, 1) ) ) _subconfig += 2 ;
if( TestFace( MCLookUpTable::Test7(_config, 2) ) ) _subconfig += 4 ;
switch( _subconfig )
{
case 0 : { AddTriangles( tiling7_1[_config], 3 ) ; break; }
case 1 : { AddTriangles( tiling7_2[_config][0], 5 ) ; break; }
case 2 : { AddTriangles( tiling7_2[_config][1], 5 ) ; break; }
case 3 : { ComputeCVertex(v12); AddTriangles( tiling7_3[_config][0], 9, v12 ) ; break ; }
case 4 : { AddTriangles( tiling7_2[_config][2], 5 ) ; break ;}
case 5 : { ComputeCVertex(v12); AddTriangles( tiling7_3[_config][1], 9, v12 ) ; break ; }
case 6 : { ComputeCVertex(v12); AddTriangles( tiling7_3[_config][2], 9, v12 ) ; break ; }
case 0 : { AddTriangles( MCLookUpTable::Tiling7_1(_config), 3 ) ; break; }
case 1 : { AddTriangles( MCLookUpTable::Tiling7_2(_config,0), 5 ) ; break; }
case 2 : { AddTriangles( MCLookUpTable::Tiling7_2(_config,1), 5 ) ; break; }
case 3 : { ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling7_3(_config,0), 9, v12 ) ; break ; }
case 4 : { AddTriangles( MCLookUpTable::Tiling7_2(_config, 2), 5 ) ; break ;}
case 5 : { ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling7_3(_config,1), 9, v12 ) ; break ; }
case 6 : { ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling7_3(_config,2), 9, v12 ) ; break ; }
case 7 :
{
if( TestInterior( test7[_config][3]) ) AddTriangles( tiling7_4_2[_config], 9 ) ;
else AddTriangles( tiling7_4_1[_config], 5 ) ;
if( TestInterior( MCLookUpTable::Test7(_config, 3) ) )
AddTriangles( MCLookUpTable::Tiling7_4_2(_config), 9 ) ;
else
AddTriangles( MCLookUpTable::Tiling7_4_1(_config), 5 ) ;
break ;
}
};
break ;
} // end of case 7
case 8 : { AddTriangles( tiling8[_config], 2 ) ; break ;}
case 9 : { AddTriangles( tiling9[_config], 4 ) ; break ;}
case 8 : { AddTriangles( MCLookUpTable::Tiling8(_config), 2 ) ; break ;}
case 9 : { AddTriangles( MCLookUpTable::Tiling9(_config), 4 ) ; break ;}
case 10 :
{
if( TestFace( test10[_config][0]) )
if( TestFace( MCLookUpTable::Test10(_config, 0)) ) //if( TestFace( test10[_config][0]) )
{
if( TestFace( test10[_config][1]) )
AddTriangles( tiling10_1_1_[_config], 4 ) ; // 10.1.1
if( TestFace( MCLookUpTable::Test10(_config,1) ) )
AddTriangles( MCLookUpTable::Tiling10_1_1_(_config), 4 ) ; // 10.1.1
else
{
ComputeCVertex(v12);
AddTriangles( tiling10_2[_config], 8, v12 ) ; // 10.2
AddTriangles( MCLookUpTable::Tiling10_2(_config), 8, v12 ) ; // 10.2
}
}
else
{
if( TestFace( test10[_config][1]) )
if( TestFace( MCLookUpTable::Test10(_config, 1) ) )
{
ComputeCVertex(v12) ;
AddTriangles( tiling10_2_[_config], 8, v12 ) ; // 10.2
AddTriangles( MCLookUpTable::Tiling10_2_(_config), 8, v12 ) ; // 10.2
}
else
{
if( TestInterior( test10[_config][2]) ) AddTriangles( tiling10_1_1[_config], 4 ) ; // 10.1.1
else AddTriangles( tiling10_1_2[_config], 8 ) ; // 10.1.2
if( TestInterior( MCLookUpTable::Test10(_config, 2) ) )
AddTriangles( MCLookUpTable::Tiling10_1_1(_config), 4 ) ; // 10.1.1
else
AddTriangles( MCLookUpTable::Tiling10_1_2(_config), 8 ) ; // 10.1.2
}
}
break ;
} // end of case 10
case 11 : { AddTriangles( tiling11[_config], 4 ) ; break ; }
case 11 : { AddTriangles( MCLookUpTable::Tiling11(_config), 4 ) ; break ; }
case 12 :
{
if( TestFace( test12[_config][0]) )
if( TestFace( MCLookUpTable::Test12(_config, 0) ) ) //if( TestFace( test12[_config][0]) )
{
if( TestFace( test12[_config][1]) ) AddTriangles( tiling12_1_1_[_config], 4 ) ; // 12.1.1
if( TestFace( MCLookUpTable::Test12(_config, 1) ) )
AddTriangles( MCLookUpTable::Tiling12_1_1_(_config), 4 ) ; // 12.1.1
else
{
ComputeCVertex(v12) ;
AddTriangles( tiling12_2[_config], 8, v12 ) ; // 12.2
AddTriangles( MCLookUpTable::Tiling12_2(_config), 8, v12 ) ; // 12.2
}
}
else
{
if( TestFace( test12[_config][1]) )
if( TestFace( MCLookUpTable::Test12(_config, 1) ) )
{
ComputeCVertex(v12) ;
AddTriangles( tiling12_2_[_config], 8, v12 ) ; // 12.2
AddTriangles( MCLookUpTable::Tiling12_2_(_config), 8, v12 ) ; // 12.2
}
else
{
if( TestInterior( test12[_config][2]) ) AddTriangles( tiling12_1_1[_config], 4 ) ; // 12.1.1
else AddTriangles( tiling12_1_2[_config], 8 ) ; // 12.1.2
if( TestInterior( MCLookUpTable::Test12(_config, 2) ) )
AddTriangles( MCLookUpTable::Tiling12_1_1(_config), 4 ) ; // 12.1.1
else
AddTriangles( MCLookUpTable::Tiling12_1_2(_config), 8 ) ; // 12.1.2
}
}
break ;
} // end of case 12
case 13 :
{
if( TestFace( test13[_config][0] ) ) _subconfig += 1 ;
if( TestFace( test13[_config][1] ) ) _subconfig += 2 ;
if( TestFace( test13[_config][2] ) ) _subconfig += 4 ;
if( TestFace( test13[_config][3] ) ) _subconfig += 8 ;
if( TestFace( test13[_config][4] ) ) _subconfig += 16 ;
if( TestFace( test13[_config][5] ) ) _subconfig += 32 ;
switch( subconfig13[_subconfig] )
//if( TestFace( test13[_config][0] ) ) _subconfig += 1 ;
//if( TestFace( test13[_config][1] ) ) _subconfig += 2 ;
//if( TestFace( test13[_config][2] ) ) _subconfig += 4 ;
//if( TestFace( test13[_config][3] ) ) _subconfig += 8 ;
//if( TestFace( test13[_config][4] ) ) _subconfig += 16 ;
//if( TestFace( test13[_config][5] ) ) _subconfig += 32 ;
if( TestFace( MCLookUpTable::Test13(_config, 0) ) ) _subconfig += 1 ;
if( TestFace( MCLookUpTable::Test13(_config, 1) ) ) _subconfig += 2 ;
if( TestFace( MCLookUpTable::Test13(_config, 2) ) ) _subconfig += 4 ;
if( TestFace( MCLookUpTable::Test13(_config, 3) ) ) _subconfig += 8 ;
if( TestFace( MCLookUpTable::Test13(_config, 4) ) ) _subconfig += 16 ;
if( TestFace( MCLookUpTable::Test13(_config, 5) ) ) _subconfig += 32 ;
switch( MCLookUpTable::Subconfig13(_subconfig) ) //switch( subconfig13[_subconfig] )
{
case 0 : { /* 13.1 */ AddTriangles( tiling13_1[_config] , 4 ) ; break ; }
case 1 : { /* 13.2 */ AddTriangles( tiling13_2[_config][0], 6 ) ; break ; }
case 2 : { /* 13.2 */ AddTriangles( tiling13_2[_config][1], 6 ) ; break ; }
case 3 : { /* 13.2 */ AddTriangles( tiling13_2[_config][2], 6 ) ; break ; }
case 4 : { /* 13.2 */ AddTriangles( tiling13_2[_config][3], 6 ) ; break ; }
case 5 : { /* 13.2 */ AddTriangles( tiling13_2[_config][4], 6 ) ; break ; }
case 6 : { /* 13.2 */ AddTriangles( tiling13_2[_config][5], 6 ) ; break ; }
case 7 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][ 0], 10, v12 ) ; break ; }
case 8 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][ 1], 10, v12 ) ; break ; }
case 9 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][ 2], 10, v12 ) ; break ; }
case 10 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][ 3], 10, v12 ) ; break ; }
case 11 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][ 4], 10, v12 ) ; break ; }
case 12 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][ 5], 10, v12 ) ; break ; }
case 13 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][ 6], 10, v12 ) ; break ; }
case 14 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][ 7], 10, v12 ) ; break ; }
case 15 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][ 8], 10, v12 ) ; break ; }
case 16 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][ 9], 10, v12 ) ; break ; }
case 17 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][10], 10, v12 ) ; break ; }
case 18 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3[_config][11], 10, v12 ) ; break ; }
case 19 : { /* 13.4 */ ComputeCVertex(v12); AddTriangles( tiling13_4[_config][ 0], 12, v12 ) ; break ; }
case 20 : { /* 13.4 */ ComputeCVertex(v12); AddTriangles( tiling13_4[_config][ 1], 12, v12 ) ; break ; }
case 21 : { /* 13.4 */ ComputeCVertex(v12); AddTriangles( tiling13_4[_config][ 2], 12, v12 ) ; break ; }
case 22 : { /* 13.4 */ ComputeCVertex(v12); AddTriangles( tiling13_4[_config][ 3], 12, v12 ) ; break ; }
case 0 : { /* 13.1 */ AddTriangles( MCLookUpTable::Tiling13_1(_config) , 4 ) ; break ; }
case 1 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2(_config, 0), 6 ) ; break ; }
case 2 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2(_config, 1), 6 ) ; break ; }
case 3 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2(_config, 2), 6 ) ; break ; }
case 4 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2(_config, 3), 6 ) ; break ; }
case 5 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2(_config, 4), 6 ) ; break ; }
case 6 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2(_config, 5), 6 ) ; break ; }
case 7 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config, 0), 10, v12 ) ; break ; }
case 8 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config, 1), 10, v12 ) ; break ; }
case 9 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config, 2), 10, v12 ) ; break ; }
case 10 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config, 3), 10, v12 ) ; break ; }
case 11 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config, 4), 10, v12 ) ; break ; }
case 12 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config, 5), 10, v12 ) ; break ; }
case 13 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config, 6), 10, v12 ) ; break ; }
case 14 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config, 7), 10, v12 ) ; break ; }
case 15 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config, 8), 10, v12 ) ; break ; }
case 16 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config, 9), 10, v12 ) ; break ; }
case 17 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config,10), 10, v12 ) ; break ; }
case 18 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3(_config,11), 10, v12 ) ; break ; }
case 19 : { /* 13.4 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_4(_config, 0), 12, v12 ) ; break ; }
case 20 : { /* 13.4 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_4(_config, 1), 12, v12 ) ; break ; }
case 21 : { /* 13.4 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_4(_config, 2), 12, v12 ) ; break ; }
case 22 : { /* 13.4 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_4(_config, 3), 12, v12 ) ; break ; }
case 23 :
{ /* 13.5 */
_subconfig = 0 ;
if( TestInterior( test13[_config][6] ) ) AddTriangles( tiling13_5_1[_config][0], 6 ) ;
else AddTriangles( tiling13_5_2[_config][0], 10 ) ;
if( TestInterior( MCLookUpTable::Test13(_config, 6) ) )
AddTriangles( MCLookUpTable::Tiling13_5_1(_config, 0), 6 ) ;
else
AddTriangles( MCLookUpTable::Tiling13_5_2(_config, 0), 10 ) ;
break ;
}
case 24 :
{ /* 13.5 */
_subconfig = 1 ;
if( TestInterior( test13[_config][6] ) ) AddTriangles( tiling13_5_1[_config][1], 6 ) ;
else AddTriangles( tiling13_5_2[_config][1], 10 ) ;
if( TestInterior( MCLookUpTable::Test13(_config, 6) ) )
AddTriangles( MCLookUpTable::Tiling13_5_1(_config, 1), 6 ) ;
else
AddTriangles( MCLookUpTable::Tiling13_5_2(_config, 1), 10 ) ;
break ;
}
case 25 :
{/* 13.5 */
_subconfig = 2 ;
if( TestInterior( test13[_config][6] ) ) AddTriangles( tiling13_5_1[_config][2], 6 ) ;
else AddTriangles( tiling13_5_2[_config][2], 10 ) ;
if( TestInterior( MCLookUpTable::Test13(_config, 6) ) )
AddTriangles( MCLookUpTable::Tiling13_5_1(_config, 2), 6 ) ;
else
AddTriangles( MCLookUpTable::Tiling13_5_2(_config, 2), 10 ) ;
break ;
}
case 26 :
{/* 13.5 */
_subconfig = 3 ;
if( TestInterior( test13[_config][6] ) ) AddTriangles( tiling13_5_1[_config][3], 6 ) ;
else AddTriangles( tiling13_5_2[_config][3], 10 ) ;
if( TestInterior( MCLookUpTable::Test13(_config, 6) ) )
AddTriangles( MCLookUpTable::Tiling13_5_1(_config, 3), 6 ) ;
else
AddTriangles( MCLookUpTable::Tiling13_5_2(_config, 3), 10 ) ;
break ;
}
case 27 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][ 0], 10, v12 ) ; break ; }
case 28 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][ 1], 10, v12 ) ; break ; }
case 29 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][ 2], 10, v12 ) ; break ; }
case 30 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][ 3], 10, v12 ) ; break ; }
case 31 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][ 4], 10, v12 ) ; break ; }
case 32 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][ 5], 10, v12 ) ; break ; }
case 33 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][ 6], 10, v12 ) ; break ; }
case 34 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][ 7], 10, v12 ) ; break ; }
case 35 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][ 8], 10, v12 ) ; break ; }
case 36 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][ 9], 10, v12 ) ; break ; }
case 37 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][10], 10, v12 ) ; break ; }
case 38 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( tiling13_3_[_config][11], 10, v12 ) ; break ; }
case 39 : { /* 13.2 */ AddTriangles( tiling13_2_[_config][0], 6 ) ; break ; }
case 40 : { /* 13.2 */ AddTriangles( tiling13_2_[_config][1], 6 ) ; break ; }
case 41 : { /* 13.2 */ AddTriangles( tiling13_2_[_config][2], 6 ) ; break ; }
case 42 : { /* 13.2 */ AddTriangles( tiling13_2_[_config][3], 6 ) ; break ; }
case 43 : { /* 13.2 */ AddTriangles( tiling13_2_[_config][4], 6 ) ; break ; }
case 44 : { /* 13.2 */ AddTriangles( tiling13_2_[_config][5], 6 ) ; break ; }
case 45 : { /* 13.1 */ AddTriangles( tiling13_1_[_config] , 4 ) ; break ; }
case 27 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config, 0), 10, v12 ) ; break ; }
case 28 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config, 1), 10, v12 ) ; break ; }
case 29 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config, 2), 10, v12 ) ; break ; }
case 30 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config, 3), 10, v12 ) ; break ; }
case 31 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config, 4), 10, v12 ) ; break ; }
case 32 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config, 5), 10, v12 ) ; break ; }
case 33 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config, 6), 10, v12 ) ; break ; }
case 34 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config, 7), 10, v12 ) ; break ; }
case 35 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config, 8), 10, v12 ) ; break ; }
case 36 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config, 9), 10, v12 ) ; break ; }
case 37 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config,10), 10, v12 ) ; break ; }
case 38 : { /* 13.3 */ ComputeCVertex(v12); AddTriangles( MCLookUpTable::Tiling13_3_(_config,11), 10, v12 ) ; break ; }
case 39 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2_(_config,0), 6 ) ; break ; }
case 40 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2_(_config,1), 6 ) ; break ; }
case 41 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2_(_config,2), 6 ) ; break ; }
case 42 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2_(_config,3), 6 ) ; break ; }
case 43 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2_(_config,4), 6 ) ; break ; }
case 44 : { /* 13.2 */ AddTriangles( MCLookUpTable::Tiling13_2_(_config,5), 6 ) ; break ; }
case 45 : { /* 13.1 */ AddTriangles( MCLookUpTable::Tiling13_1_(_config) , 4 ) ; break ; }
default : { /*Impossible case 13*/ assert(false); }
}
break ;
} // end of case 13
case 14 : { AddTriangles( tiling14[_config], 4 ) ; }
case 14 : { AddTriangles( MCLookUpTable::Tiling14(_config), 4 ) ; }
break ;
} //end of switch (_case)
@ -433,10 +466,10 @@ namespace vcg
case 13 :
switch( _case )
{
case 6 : edge = test6 [_config][2] ; break ;
case 7 : edge = test7 [_config][4] ; break ;
case 12 : edge = test12[_config][3] ; break ;
case 13 : edge = tiling13_5_1[_config][_subconfig][0] ; break ;
case 6 : edge = MCLookUpTable::Test6 (_config, 2) ; break ;
case 7 : edge = MCLookUpTable::Test7 (_config, 4) ; break ;
case 12 : edge = MCLookUpTable::Test12(_config, 3) ; break ;
case 13 : edge = MCLookUpTable::Tiling13_5_1(_config, _subconfig)[0] ; break ;
}
switch( edge )
{

View File

@ -10,14 +10,16 @@
//________________________________________________
#ifndef __VCG_MC_LOOK_UP_TABLE
#define __VCG_MC_LOOK_UP_TABLE
#ifndef _LOOKUPTABLE_H_
#define _LOOKUPTABLE_H_
namespace vcg
{
namespace tri
{
class MCLookUpTable
{
public:
//_____________________________________________________________________________
/**
* \brief case mapping
@ -41,6 +43,8 @@
* 0 1 0 1
*/
//-----------------------------------------------------------------------------
static const char Cases(unsigned char cubetype, unsigned char u)
{
static const char cases[256][2] = {
/* 0: */ { 0, -1 },
/* 1: 0, */ { 1, 0 },
@ -299,6 +303,8 @@ static const char cases[256][2] = {
/* 254: 1, 2, 3, 4, 5, 6, 7, */ { 1, 15 },
/* 255: 0, 1, 2, 3, 4, 5, 6, 7, */ { 0, -1 }
};
return cases[cubetype][u];
}; // end of Cases
//_____________________________________________________________________________
@ -313,6 +319,8 @@ static const char cases[256][2] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling1(unsigned char config)
{
static const char tiling1[16][3] = {
/* 1: 0, */ { 0, 8, 3 },
/* 2: 1, */ { 0, 1, 9 },
@ -331,6 +339,8 @@ static const char tiling1[16][3] = {
/* 253: 0, 2, 3, 4, 5, 6, 7, */ { 0, 9, 1 },
/* 254: 1, 2, 3, 4, 5, 6, 7, */ { 0, 3, 8 }
};
return &tiling1[config][0];
}; // end of Tiling1
//_____________________________________________________________________________
@ -345,6 +355,8 @@ static const char tiling1[16][3] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling2(unsigned char config)
{
static const char tiling2[24][6] = {
/* 3: 0, 1, */ { 1, 8, 3, 9, 8, 1 },
/* 9: 0, 3, */ { 0, 11, 2, 8, 11, 0 },
@ -371,9 +383,15 @@ static const char tiling2[24][6] = {
/* 246: 1, 2, 4, 5, 6, 7, */ { 0, 2, 11, 8, 0, 11 },
/* 252: 2, 3, 4, 5, 6, 7, */ { 1, 3, 8, 9, 1, 8 }
};
return &tiling2[config][0];
}; // end of Tiling2
//_____________________________________________________________________________
//_____________________________________________________________________________
/**
* \brief test table for case 3
* One face to test
@ -388,6 +406,8 @@ static const char tiling2[24][6] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char Test3(unsigned char config)
{
static const char test3[24] = {
/* 5: 0, 2, */ 5,
/* 33: 0, 5, */ 1,
@ -414,6 +434,9 @@ static const char test3[24] = {
/* 222: 1, 2, 3, 4, 6, 7, */ -1,
/* 250: 1, 3, 4, 5, 6, 7, */ -5
};
return test3[config];
}; // end of Test3
//_____________________________________________________________________________
/**
@ -426,6 +449,8 @@ static const char test3[24] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling3_1(unsigned char config)
{
static const char tiling3_1[24][6] = {
/* 5: 0, 2, */ { 0, 8, 3, 1, 2, 10 },
/* 33: 0, 5, */ { 9, 5, 4, 0, 8, 3 },
@ -452,6 +477,9 @@ static const char tiling3_1[24][6] = {
/* 222: 1, 2, 3, 4, 6, 7, */ { 4, 5, 9, 3, 8, 0 },
/* 250: 1, 3, 4, 5, 6, 7, */ { 3, 8, 0, 10, 2, 1 }
};
return &tiling3_1[config][0];
}; // end of Tiling3_1
//_____________________________________________________________________________
/**
@ -464,6 +492,8 @@ static const char tiling3_1[24][6] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling3_2(unsigned char config)
{
static const char tiling3_2[24][12] = {
/* 5: 0, 2, */ { 10, 3, 2, 10, 8, 3, 10, 1, 0, 8, 10, 0 },
/* 33: 0, 5, */ { 3, 4, 8, 3, 5, 4, 3, 0, 9, 5, 3, 9 },
@ -490,6 +520,8 @@ static const char tiling3_2[24][12] = {
/* 222: 1, 2, 3, 4, 6, 7, */ { 8, 4, 3, 4, 5, 3, 9, 0, 3, 9, 3, 5 },
/* 250: 1, 3, 4, 5, 6, 7, */ { 2, 3, 10, 3, 8, 10, 0, 1, 10, 0, 10, 8 }
};
return &tiling3_2[config][0];
}; // end of Tiling3_2
//_____________________________________________________________________________
@ -509,6 +541,8 @@ static const char tiling3_2[24][12] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char Test4(unsigned char config)
{
static const char test4[8] = {
/* 65: 0, 6, */ 7,
/* 130: 1, 7, */ 7,
@ -519,6 +553,9 @@ static const char test4[8] = {
/* 125: 0, 2, 3, 4, 5, 6, */ -7,
/* 190: 1, 2, 3, 4, 5, 7, */ -7
};
return test4[config];
}; // end of Test4
//_____________________________________________________________________________
/**
@ -531,6 +568,8 @@ static const char test4[8] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling4_1(unsigned char config)
{
static const char tiling4_1[8][6] = {
/* 65: 0, 6, */ { 0, 8, 3, 5, 10, 6 },
/* 130: 1, 7, */ { 0, 1, 9, 11, 7, 6 },
@ -541,6 +580,9 @@ static const char tiling4_1[8][6] = {
/* 125: 0, 2, 3, 4, 5, 6, */ { 9, 1, 0, 6, 7, 11 },
/* 190: 1, 2, 3, 4, 5, 7, */ { 3, 8, 0, 6, 10, 5 }
};
return &tiling4_1[config][0];
}; // end of Tiling4_1
//_____________________________________________________________________________
/**
@ -553,6 +595,8 @@ static const char tiling4_1[8][6] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling4_2(unsigned char config)
{
static const char tiling4_2[8][18] = {
/* 65: 0, 6, */ { 8, 5, 0, 5, 8, 6, 3, 6, 8, 6, 3, 10, 0, 10, 3, 10, 0, 5 },
/* 130: 1, 7, */ { 9, 6, 1, 6, 9, 7, 0, 7, 9, 7, 0, 11, 1, 11, 0, 11, 1, 6 },
@ -563,9 +607,12 @@ static const char tiling4_2[8][18] = {
/* 125: 0, 2, 3, 4, 5, 6, */ { 1, 6, 9, 7, 9, 6, 9, 7, 0, 11, 0, 7, 0, 11, 1, 6, 1, 11 },
/* 190: 1, 2, 3, 4, 5, 7, */ { 0, 5, 8, 6, 8, 5, 8, 6, 3, 10, 3, 6, 3, 10, 0, 5, 0, 10 }
};
return &tiling4_2[config][0];
}; // end of Tiling4_2
//_____________________________________________________________________________
//_____________________________________________________________________________
/**
* \brief tiling table for case 5
@ -577,6 +624,8 @@ static const char tiling4_2[8][18] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling5(unsigned char config)
{
static const char tiling5[48][9] = {
/* 7: 0, 1, 2, */ { 2, 8, 3, 2, 10, 8, 10, 9, 8 },
/* 11: 0, 1, 3, */ { 1, 11, 2, 1, 9, 11, 9, 8, 11 },
@ -627,6 +676,8 @@ static const char tiling5[48][9] = {
/* 244: 2, 4, 5, 6, 7, */ { 1, 2, 11, 1, 11, 9, 9, 11, 8 },
/* 248: 3, 4, 5, 6, 7, */ { 2, 3, 8, 2, 8, 10, 10, 8, 9 }
};
return &tiling5[config][0];
}; // end of Tiling5
//_____________________________________________________________________________
@ -648,6 +699,8 @@ static const char tiling5[48][9] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char Test6(unsigned char config, int u)
{
static const char test6[48][3] = {
/* 67: 0, 1, 6, */ { 2, 7, 10 },
/* 131: 0, 1, 7, */ { 4, 7, 11 },
@ -698,6 +751,9 @@ static const char test6[48][3] = {
/* 124: 2, 3, 4, 5, 6, */ { -4, -7, 11 },
/* 188: 2, 3, 4, 5, 7, */ { -2, -7, 10 }
};
return test6[config][u];
}; // end of Test6
//_____________________________________________________________________________
/**
@ -710,6 +766,8 @@ static const char test6[48][3] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling6_1_1(unsigned char config)
{
static const char tiling6_1_1[48][9] = {
/* 67: 0, 1, 6, */ { 6, 5, 10, 3, 1, 8, 9, 8, 1 },
/* 131: 0, 1, 7, */ { 11, 7, 6, 9, 3, 1, 3, 9, 8 },
@ -760,6 +818,9 @@ static const char tiling6_1_1[48][9] = {
/* 124: 2, 3, 4, 5, 6, */ { 6, 7, 11, 1, 3, 9, 8, 9, 3 },
/* 188: 2, 3, 4, 5, 7, */ { 10, 5, 6, 8, 1, 3, 1, 8, 9 }
};
return &tiling6_1_1[config][0];
}; // end of Tiling6_1_1
//_____________________________________________________________________________
/**
@ -772,6 +833,8 @@ static const char tiling6_1_1[48][9] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling6_1_2(unsigned char config)
{
static const char tiling6_1_2[48][21] = {
/* 67: 0, 1, 6, */ { 1, 10, 3, 6, 3, 10, 3, 6, 8, 5, 8, 6, 8, 5, 9, 1, 9, 5, 10, 1, 5 },
/* 131: 0, 1, 7, */ { 1, 11, 3, 11, 1, 6, 9, 6, 1, 6, 9, 7, 8, 7, 9, 7, 8, 3, 7, 3, 11 },
@ -822,6 +885,10 @@ static const char tiling6_1_2[48][21] = {
/* 124: 2, 3, 4, 5, 6, */ { 3, 11, 1, 6, 1, 11, 1, 6, 9, 7, 9, 6, 9, 7, 8, 3, 8, 7, 11, 3, 7 },
/* 188: 2, 3, 4, 5, 7, */ { 3, 10, 1, 10, 3, 6, 8, 6, 3, 6, 8, 5, 9, 5, 8, 5, 9, 1, 5, 1, 10 }
};
return &tiling6_1_2[config][0];
}; // end of Tiling6_1_2
//_____________________________________________________________________________
/**
@ -834,6 +901,8 @@ static const char tiling6_1_2[48][21] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling6_2(unsigned char config)
{
static const char tiling6_2[48][15] = {
/* 67: 0, 1, 6, */ { 1, 10, 3, 6, 3, 10, 3, 6, 8, 5, 8, 6, 8, 5, 9 },
/* 131: 0, 1, 7, */ { 1, 11, 3, 11, 1, 6, 9, 6, 1, 6, 9, 7, 8, 7, 9 },
@ -884,10 +953,11 @@ static const char tiling6_2[48][15] = {
/* 124: 2, 3, 4, 5, 6, */ { 3, 11, 1, 6, 1, 11, 1, 6, 9, 7, 9, 6, 9, 7, 8 },
/* 188: 2, 3, 4, 5, 7, */ { 3, 10, 1, 10, 3, 6, 8, 6, 3, 6, 8, 5, 9, 5, 8 }
};
return &tiling6_2[config][0];
}; // end of Tiling6_2
//_____________________________________________________________________________
//_____________________________________________________________________________
/**
* \brief test table for case 7
@ -912,6 +982,8 @@ static const char tiling6_2[48][15] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char Test7(unsigned char config, int u)
{
static const char test7[16][5] = {
/* 37: 0, 2, 5, */ { 1, 2, 5, 7, 1 },
/* 133: 0, 2, 7, */ { 3, 4, 5, 7, 3 },
@ -930,6 +1002,9 @@ static const char test7[16][5] = {
/* 122: 1, 3, 4, 5, 6, */ { -3, -4, -5, -7, 3 },
/* 218: 1, 3, 4, 6, 7, */ { -1, -2, -5, -7, 1 }
};
return test7[config][u];
}; // end of Test7
//_____________________________________________________________________________
/**
@ -942,6 +1017,8 @@ static const char test7[16][5] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling7_1(unsigned char config)
{
static const char tiling7_1[16][9] = {
/* 37: 0, 2, 5, */ { 9, 5, 4, 10, 1, 2, 8, 3, 0 },
/* 133: 0, 2, 7, */ { 11, 7, 6, 8, 3, 0, 10, 1, 2 },
@ -960,6 +1037,9 @@ static const char tiling7_1[16][9] = {
/* 122: 1, 3, 4, 5, 6, */ { 6, 7, 11, 0, 3, 8, 2, 1, 10 },
/* 218: 1, 3, 4, 6, 7, */ { 4, 5, 9, 2, 1, 10, 0, 3, 8 }
};
return &tiling7_1[config][0];
}; // end of Tiling7_1
//_____________________________________________________________________________
/**
@ -972,6 +1052,8 @@ static const char tiling7_1[16][9] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling7_2(unsigned char config, int u)
{
static const char tiling7_2[16][3][15] = {
/* 37: 0, 2, 5, */ {
/* 1,0 */ { 1, 2, 10, 3, 4, 8, 4, 3, 5, 0, 5, 3, 5, 0, 9 },
@ -1053,6 +1135,9 @@ static const char tiling7_2[16][3][15] = {
/* 0,1 */ { 8, 0, 3, 4, 1, 9, 1, 4, 2, 5, 2, 4, 2, 5, 10 },
/* 1,1 */ { 4, 5, 9, 1, 10, 0, 8, 0, 10, 2, 8, 10, 8, 2, 3 } }
};
return &tiling7_2[config][u][0];
}; // end of Tiling7_2
//_____________________________________________________________________________
/**
@ -1065,6 +1150,8 @@ static const char tiling7_2[16][3][15] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling7_3(unsigned char config, unsigned char u)
{
static const char tiling7_3[16][3][27] = {
/* 37: 0, 2, 5, */ {
/* 1,0 */ { 12, 2, 10, 12, 10, 5, 12, 5, 4, 12, 4, 8, 12, 8, 3, 12, 3, 0, 12, 0, 9, 12, 9, 1, 12, 1, 2 },
@ -1146,6 +1233,9 @@ static const char tiling7_3[16][3][27] = {
/* 0,1 */ { 4, 5, 12, 8, 4, 12, 3, 8, 12, 2, 3, 12, 10, 2, 12, 1, 10, 12, 0, 1, 12, 9, 0, 12, 5, 9, 12 },
/* 1,1 */ { 12, 4, 5, 12, 5, 10, 12, 10, 2, 12, 2, 3, 12, 3, 8, 12, 8, 0, 12, 0, 1, 12, 1, 9, 12, 9, 4 } }
};
return &tiling7_3[config][u][0];
}; // end of Tiling7_3
//_____________________________________________________________________________
/**
@ -1158,6 +1248,8 @@ static const char tiling7_3[16][3][27] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling7_4_1(unsigned char config)
{
static const char tiling7_4_1[16][15] = {
/* 37: 0, 2, 5, */ { 3, 4, 8, 4, 3, 10, 2, 10, 3, 4, 10, 5, 9, 1, 0 },
/* 133: 0, 2, 7, */ { 1, 6, 10, 6, 1, 8, 0, 8, 1, 6, 8, 7, 11, 3, 2 },
@ -1176,6 +1268,8 @@ static const char tiling7_4_1[16][15] = {
/* 122: 1, 3, 4, 5, 6, */ { 10, 6, 1, 8, 1, 6, 1, 8, 0, 7, 8, 6, 2, 3, 11 },
/* 218: 1, 3, 4, 6, 7, */ { 8, 4, 3, 10, 3, 4, 3, 10, 2, 5, 10, 4, 0, 1, 9 }
};
return &tiling7_4_1[config][0];
}; // end of Tiling7_4_1
//_____________________________________________________________________________
/**
@ -1188,6 +1282,8 @@ static const char tiling7_4_1[16][15] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling7_4_2(unsigned char config)
{
static const char tiling7_4_2[16][27] = {
/* 37: 0, 2, 5, */ { 9, 4, 8, 4, 9, 5, 10, 5, 9, 1, 10, 9, 10, 1, 2, 0, 2, 1, 2, 0, 3, 8, 3, 0, 9, 8, 0 },
/* 133: 0, 2, 7, */ { 11, 6, 10, 6, 11, 7, 8, 7, 11, 3, 8, 11, 8, 3, 0, 2, 0, 3, 0, 2, 1, 10, 1, 2, 11, 10, 2 },
@ -1206,6 +1302,8 @@ static const char tiling7_4_2[16][27] = {
/* 122: 1, 3, 4, 5, 6, */ { 10, 6, 11, 7, 11, 6, 11, 7, 8, 11, 8, 3, 0, 3, 8, 3, 0, 2, 1, 2, 0, 2, 1, 10, 2, 10, 11 },
/* 218: 1, 3, 4, 6, 7, */ { 8, 4, 9, 5, 9, 4, 9, 5, 10, 9, 10, 1, 2, 1, 10, 1, 2, 0, 3, 0, 2, 0, 3, 8, 0, 8, 9 }
};
return &tiling7_4_2[config][0];
}; // end of Tiling7_4_2
//_____________________________________________________________________________
@ -1220,6 +1318,8 @@ static const char tiling7_4_2[16][27] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling8(unsigned char config)
{
static const char tiling8[6][6] = {
/* 15: 0, 1, 2, 3, */ { 9, 8, 10, 10, 8, 11 },
/* 51: 0, 1, 4, 5, */ { 1, 5, 3, 3, 5, 7 },
@ -1228,9 +1328,10 @@ static const char tiling8[6][6] = {
/* 204: 2, 3, 6, 7, */ { 1, 3, 5, 3, 7, 5 },
/* 240: 4, 5, 6, 7, */ { 9, 10, 8, 10, 11, 8 }
};
return &tiling8[config][0];
}; // end of Tiling8
//_____________________________________________________________________________
//_____________________________________________________________________________
/**
* \brief tiling table for case 9
@ -1242,6 +1343,8 @@ static const char tiling8[6][6] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling9(unsigned char config)
{
static const char tiling9[8][12] = {
/* 39: 0, 1, 2, 5, */ { 2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8 },
/* 27: 0, 1, 3, 4, */ { 4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1 },
@ -1252,10 +1355,11 @@ static const char tiling9[8][12] = {
/* 228: 2, 5, 6, 7, */ { 4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2 },
/* 216: 3, 4, 6, 7, */ { 2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4 }
};
return &tiling9[config][0];
};
//_____________________________________________________________________________
//_____________________________________________________________________________
/**
* \brief test table for case 10
@ -1275,6 +1379,8 @@ static const char tiling9[8][12] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char Test10(unsigned char config, int u)
{
static const char test10[6][3] = {
/* 195: 0, 1, 6, 7, */ { 2, 4, 7 },
/* 85: 0, 2, 4, 6, */ { 5, 6, 7 },
@ -1283,6 +1389,9 @@ static const char test10[6][3] = {
/* 170: 1, 3, 5, 7, */ { 5, 6, 7 },
/* 60: 2, 3, 4, 5, */ { 2, 4, 7 }
};
return test10[config][u];
}; // end of Test10
//_____________________________________________________________________________
/**
@ -1295,6 +1404,8 @@ static const char test10[6][3] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling10_1_1(unsigned char config)
{
static const char tiling10_1_1[6][12] = {
/* 195: 0, 1, 6, 7, */ { 5, 10, 7, 11, 7, 10, 8, 1, 9, 1, 8, 3 },
/* 85: 0, 2, 4, 6, */ { 1, 2, 5, 6, 5, 2, 4, 3, 0, 3, 4, 7 },
@ -1303,6 +1414,9 @@ static const char tiling10_1_1[6][12] = {
/* 170: 1, 3, 5, 7, */ { 7, 2, 3, 2, 7, 6, 0, 1, 4, 5, 4, 1 },
/* 60: 2, 3, 4, 5, */ { 7, 9, 5, 9, 7, 8, 10, 1, 11, 3, 11, 1 }
};
return &tiling10_1_1[config][0];
}; // end of Tiling10_1_1
//_____________________________________________________________________________
/**
@ -1315,6 +1429,8 @@ static const char tiling10_1_1[6][12] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling10_1_1_(unsigned char config)
{
static const char tiling10_1_1_[6][12] = {
/* 195: 0, 1, 6, 7, */ { 5, 9, 7, 8, 7, 9, 11, 1, 10, 1, 11, 3 },
/* 85: 0, 2, 4, 6, */ { 3, 2, 7, 6, 7, 2, 4, 1, 0, 1, 4, 5 },
@ -1323,6 +1439,9 @@ static const char tiling10_1_1_[6][12] = {
/* 170: 1, 3, 5, 7, */ { 5, 2, 1, 2, 5, 6, 0, 3, 4, 7, 4, 3 },
/* 60: 2, 3, 4, 5, */ { 7, 10, 5, 10, 7, 11, 9, 1, 8, 3, 8, 1 }
};
return &tiling10_1_1_[config][0];
}; // end of Tiling10_1_1_
//_____________________________________________________________________________
/**
@ -1335,6 +1454,8 @@ static const char tiling10_1_1_[6][12] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling10_1_2(unsigned char config)
{
static const char tiling10_1_2[6][24] = {
/* 195: 0, 1, 6, 7, */ { 3, 11, 7, 3, 7, 8, 9, 8, 7, 5, 9, 7, 9, 5, 10, 9, 10, 1, 3, 1, 10, 11, 3, 10 },
/* 85: 0, 2, 4, 6, */ { 7, 6, 5, 7, 5, 4, 0, 4, 5, 1, 0, 5, 0, 1, 2, 0, 2, 3, 7, 3, 2, 6, 7, 2 },
@ -1343,6 +1464,8 @@ static const char tiling10_1_2[6][24] = {
/* 170: 1, 3, 5, 7, */ { 7, 6, 5, 4, 7, 5, 7, 4, 0, 7, 0, 3, 2, 3, 0, 1, 2, 0, 2, 1, 5, 2, 5, 6 },
/* 60: 2, 3, 4, 5, */ { 7, 8, 3, 11, 7, 3, 7, 11, 10, 7, 10, 5, 9, 5, 10, 1, 9, 10, 9, 1, 3, 9, 3, 8 }
};
return &tiling10_1_2[config][0];
}; // end of Tiling10_1_2
//_____________________________________________________________________________
/**
@ -1355,6 +1478,8 @@ static const char tiling10_1_2[6][24] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling10_2(unsigned char config)
{
static const char tiling10_2[6][24] = {
/* 195: 0, 1, 6, 7, */ { 12, 5, 9, 12, 9, 8, 12, 8, 3, 12, 3, 1, 12, 1, 10, 12, 10, 11, 12, 11, 7, 12, 7, 5 },
/* 85: 0, 2, 4, 6, */ { 12, 1, 0, 12, 0, 4, 12, 4, 7, 12, 7, 3, 12, 3, 2, 12, 2, 6, 12, 6, 5, 12, 5, 1 },
@ -1363,6 +1488,10 @@ static const char tiling10_2[6][24] = {
/* 170: 1, 3, 5, 7, */ { 0, 3, 12, 4, 0, 12, 5, 4, 12, 1, 5, 12, 2, 1, 12, 6, 2, 12, 7, 6, 12, 3, 7, 12 },
/* 60: 2, 3, 4, 5, */ { 10, 5, 12, 11, 10, 12, 3, 11, 12, 1, 3, 12, 9, 1, 12, 8, 9, 12, 7, 8, 12, 5, 7, 12 }
};
return &tiling10_2[config][0];
}; // end of Tiling10_2
//_____________________________________________________________________________
/**
@ -1375,6 +1504,8 @@ static const char tiling10_2[6][24] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling10_2_(unsigned char config)
{
static const char tiling10_2_[6][24] = {
/* 195: 0, 1, 6, 7, */ { 8, 7, 12, 9, 8, 12, 1, 9, 12, 3, 1, 12, 11, 3, 12, 10, 11, 12, 5, 10, 12, 7, 5, 12 },
/* 85: 0, 2, 4, 6, */ { 4, 5, 12, 0, 4, 12, 3, 0, 12, 7, 3, 12, 6, 7, 12, 2, 6, 12, 1, 2, 12, 5, 1, 12 },
@ -1383,6 +1514,8 @@ static const char tiling10_2_[6][24] = {
/* 170: 1, 3, 5, 7, */ { 12, 7, 4, 12, 4, 0, 12, 0, 1, 12, 1, 5, 12, 5, 6, 12, 6, 2, 12, 2, 3, 12, 3, 7 },
/* 60: 2, 3, 4, 5, */ { 12, 7, 11, 12, 11, 10, 12, 10, 1, 12, 1, 3, 12, 3, 8, 12, 8, 9, 12, 9, 5, 12, 5, 7 }
};
return &tiling10_2_[config][0];
}; // end of Tiling10_2_
//_____________________________________________________________________________
@ -1397,6 +1530,8 @@ static const char tiling10_2_[6][24] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling11(unsigned char config)
{
static const char tiling11[12][12] = {
/* 23: 0, 1, 2, 4, */ { 2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4 },
/* 139: 0, 1, 3, 7, */ { 1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6 },
@ -1411,9 +1546,12 @@ static const char tiling11[12][12] = {
/* 116: 2, 4, 5, 6, */ { 1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7 },
/* 232: 3, 5, 6, 7, */ { 2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9 }
};
return &tiling11[config][0];
}; // end of tiling11
//_____________________________________________________________________________
//_____________________________________________________________________________
/**
* \brief test table for case 12
@ -1434,6 +1572,8 @@ static const char tiling11[12][12] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char Test12(unsigned char config, int u)
{
static const char test12[24][4] = {
/* 135: 0, 1, 2, 7, */ { 4, 3, 7, 11 },
/* 75: 0, 1, 3, 6, */ { 3, 2, 7, 10 },
@ -1460,6 +1600,9 @@ static const char test12[24][4] = {
/* 180: 2, 4, 5, 7, */ { 2, 3, 7, 10 },
/* 120: 3, 4, 5, 6, */ { 3, 4, 7, 11 }
};
return test12[config][u];
};
//_____________________________________________________________________________
/**
@ -1472,6 +1615,8 @@ static const char test12[24][4] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling12_1_1(unsigned char config)
{
static const char tiling12_1_1[24][12] = {
/* 135: 0, 1, 2, 7, */ { 7, 6, 11, 10, 3, 2, 3, 10, 8, 9, 8, 10 },
/* 75: 0, 1, 3, 6, */ { 6, 5, 10, 9, 2, 1, 2, 9, 11, 8, 11, 9 },
@ -1498,6 +1643,9 @@ static const char tiling12_1_1[24][12] = {
/* 180: 2, 4, 5, 7, */ { 10, 1, 2, 5, 6, 9, 11, 9, 6, 9, 11, 8 },
/* 120: 3, 4, 5, 6, */ { 11, 2, 3, 6, 7, 10, 8, 10, 7, 10, 8, 9 }
};
return &tiling12_1_1[config][0];
}; // end of Tiling12_1_1
//_____________________________________________________________________________
/**
@ -1510,6 +1658,8 @@ static const char tiling12_1_1[24][12] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling12_1_1_(unsigned char config)
{
static const char tiling12_1_1_[24][12] = {
/* 135: 0, 1, 2, 7, */ { 3, 2, 11, 10, 7, 6, 7, 10, 8, 9, 8, 10 },
/* 75: 0, 1, 3, 6, */ { 2, 1, 10, 9, 6, 5, 6, 9, 11, 8, 11, 9 },
@ -1536,6 +1686,9 @@ static const char tiling12_1_1_[24][12] = {
/* 180: 2, 4, 5, 7, */ { 10, 5, 6, 1, 2, 9, 11, 9, 2, 9, 11, 8 },
/* 120: 3, 4, 5, 6, */ { 11, 6, 7, 2, 3, 10, 8, 10, 3, 10, 8, 9 }
};
return &tiling12_1_1_[config][0];
}; // end of Tiling12_1_1_
//_____________________________________________________________________________
/**
@ -1548,6 +1701,8 @@ static const char tiling12_1_1_[24][12] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling12_1_2(unsigned char config)
{
static const char tiling12_1_2[24][24] = {
/* 135: 0, 1, 2, 7, */ { 7, 3, 11, 3, 7, 8, 9, 8, 7, 6, 9, 7, 9, 6, 10, 2, 10, 6, 11, 2, 6, 2, 11, 3 },
/* 75: 0, 1, 3, 6, */ { 6, 2, 10, 2, 6, 11, 8, 11, 6, 5, 8, 6, 8, 5, 9, 1, 9, 5, 10, 1, 5, 1, 10, 2 },
@ -1574,6 +1729,9 @@ static const char tiling12_1_2[24][24] = {
/* 180: 2, 4, 5, 7, */ { 10, 6, 2, 11, 2, 6, 2, 11, 8, 2, 8, 1, 9, 1, 8, 1, 9, 5, 1, 5, 10, 6, 10, 5 },
/* 120: 3, 4, 5, 6, */ { 11, 7, 3, 8, 3, 7, 3, 8, 9, 3, 9, 2, 10, 2, 9, 2, 10, 6, 2, 6, 11, 7, 11, 6 }
};
return &tiling12_1_2[config][0];
}; // end of Tiling12_1_2
//_____________________________________________________________________________
/**
@ -1586,6 +1744,8 @@ static const char tiling12_1_2[24][24] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling12_2(unsigned char config)
{
static const char tiling12_2[24][24] = {
/* 135: 0, 1, 2, 7, */ { 9, 8, 12, 10, 9, 12, 2, 10, 12, 3, 2, 12, 11, 3, 12, 6, 11, 12, 7, 6, 12, 8, 7, 12 },
/* 75: 0, 1, 3, 6, */ { 8, 11, 12, 9, 8, 12, 1, 9, 12, 2, 1, 12, 10, 2, 12, 5, 10, 12, 6, 5, 12, 11, 6, 12 },
@ -1612,6 +1772,9 @@ static const char tiling12_2[24][24] = {
/* 180: 2, 4, 5, 7, */ { 12, 11, 8, 12, 8, 9, 12, 9, 1, 12, 1, 2, 12, 2, 10, 12, 10, 5, 12, 5, 6, 12, 6, 11 },
/* 120: 3, 4, 5, 6, */ { 12, 8, 9, 12, 9, 10, 12, 10, 2, 12, 2, 3, 12, 3, 11, 12, 11, 6, 12, 6, 7, 12, 7, 8 }
};
return &tiling12_2[config][0];
}; // end of Tiling12_2
//_____________________________________________________________________________
/**
@ -1624,6 +1787,8 @@ static const char tiling12_2[24][24] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling12_2_(unsigned char config)
{
static const char tiling12_2_[24][24] = {
/* 135: 0, 1, 2, 7, */ { 12, 2, 11, 12, 11, 7, 12, 7, 6, 12, 6, 10, 12, 10, 9, 12, 9, 8, 12, 8, 3, 12, 3, 2 },
/* 75: 0, 1, 3, 6, */ { 12, 1, 10, 12, 10, 6, 12, 6, 5, 12, 5, 9, 12, 9, 8, 12, 8, 11, 12, 11, 2, 12, 2, 1 },
@ -1650,10 +1815,11 @@ static const char tiling12_2_[24][24] = {
/* 180: 2, 4, 5, 7, */ { 10, 1, 12, 6, 10, 12, 5, 6, 12, 9, 5, 12, 8, 9, 12, 11, 8, 12, 2, 11, 12, 1, 2, 12 },
/* 120: 3, 4, 5, 6, */ { 11, 2, 12, 7, 11, 12, 6, 7, 12, 10, 6, 12, 9, 10, 12, 8, 9, 12, 3, 8, 12, 2, 3, 12 }
};
return &tiling12_2_[config][0];
}; // end of Tiling12_2_
//_____________________________________________________________________________
//_____________________________________________________________________________
/**
* \brief test table for case 13
@ -1668,12 +1834,14 @@ static const char tiling12_2_[24][24] = {
*/
//-----------------------------------------------------------------------------
/* 13: face test */
static const char Test13(unsigned char config, int u)
{
static const char test13[2][7] = {
/* 165: 0, 2, 5, 7, */ { 1,2,3,4,5,6,7 },
/* 90: 1, 3, 4, 6, */ { 2,3,4,1,5,6,7 },
};
return test13[config][u];
}; // end of Test13
//_____________________________________________________________________________
/**
@ -1689,6 +1857,8 @@ static const char test13[2][7] = {
*/
//-----------------------------------------------------------------------------
/* 13: sub configs */
static const char Subconfig13(unsigned char config)
{
static const char subconfig13[64] = {
/* 0: 0,0,0,0,0,0 */ 0,
/* 1: 1,0,0,0,0,0 */ 1,
@ -1755,7 +1925,8 @@ static const char subconfig13[64] = {
/* 62: 0,1,1,1,1,1 */ 39,
/* 63: 1,1,1,1,1,1 */ 45,
};
return subconfig13[config];
}; // end of Subconfig13
//_____________________________________________________________________________
/**
@ -1769,10 +1940,15 @@ static const char subconfig13[64] = {
*/
//-----------------------------------------------------------------------------
/* 13.1 */
static const char* Tiling13_1(unsigned char config)
{
static const char tiling13_1[2][12] = {
/* 165: 0, 2, 5, 7, */ { 11, 7, 6, 1, 2, 10, 8, 3, 0, 9, 5, 4 },
/* 90: 1, 3, 4, 6, */ { 8, 4, 7, 2, 3, 11, 9, 0, 1, 10, 6, 5 }
};
return &tiling13_1[config][0];
}; // end of Tiling13_1
//_____________________________________________________________________________
/**
@ -1786,10 +1962,16 @@ static const char tiling13_1[2][12] = {
*/
//-----------------------------------------------------------------------------
/* 13.1 */
static const char* Tiling13_1_(unsigned char config)
{
static const char tiling13_1_[2][12] = {
/* 165: 0, 2, 5, 7, */ { 7, 4, 8, 11, 3, 2, 1, 0, 9, 5, 6, 10 },
/* 90: 1, 3, 4, 6, */ { 6, 7, 11, 10, 2, 1, 0, 3, 8, 4, 5, 9 }
};
return &tiling13_1_[config][0];
}; // end of Tiling13_1_
//_____________________________________________________________________________
/**
@ -1803,6 +1985,8 @@ static const char tiling13_1_[2][12] = {
*/
//-----------------------------------------------------------------------------
/* 13.2 */
static const char* Tiling13_2(unsigned char config, unsigned char u)
{
static const char tiling13_2[2][6][18] = {
/* 165: 0, 2, 5, 7, */ {
/* 1 */ { 1, 2, 10, 11, 7, 6, 3, 4, 8, 4, 3, 5, 0, 5, 3, 5, 0, 9 },
@ -1820,6 +2004,9 @@ static const char tiling13_2[2][6][18] = {
/* 5 */ { 6, 5, 10, 8, 4, 7, 1, 11, 2, 11, 1, 9, 11, 9, 3, 0, 3, 9 },
/* 6 */ { 2, 3, 11, 0, 1, 9, 5, 10, 4, 8, 4, 10, 6, 8, 10, 8, 6, 7 }
} };
return &tiling13_2[config][u][0];
}; // end of Tiling13_2
//_____________________________________________________________________________
/**
@ -1833,6 +2020,8 @@ static const char tiling13_2[2][6][18] = {
*/
//-----------------------------------------------------------------------------
/* 13.2 */
static const char* Tiling13_2_(unsigned char config, unsigned char u)
{
static const char tiling13_2_[2][6][18] = {
/* 165: 0, 2, 5, 7, */ {
/* 1 */ { 10, 5, 6, 11, 3, 2, 7, 0, 8, 0, 7, 1, 4, 1, 7, 1, 4, 9 },
@ -1850,6 +2039,10 @@ static const char tiling13_2_[2][6][18] = {
/* 5 */ { 6, 7, 11, 4, 5, 9, 3, 8, 2, 10, 2, 8, 0, 10, 8, 10, 0, 1 },
/* 6 */ { 8, 0, 3, 10, 2, 1, 5, 11, 6, 11, 5, 9, 11, 9, 7, 4, 7, 9 }
} };
return &tiling13_2_[config][u][0];
}; // end of Tiling13_2_
//_____________________________________________________________________________
/**
@ -1863,6 +2056,8 @@ static const char tiling13_2_[2][6][18] = {
*/
//-----------------------------------------------------------------------------
/* 13.3 */
static const char* Tiling13_3(unsigned char config, unsigned int u)
{
static const char tiling13_3[2][12][30] = {
/* 165: 0, 2, 5, 7, */ {
/* 1,2 */ { 11, 7, 6, 12, 2, 10, 12, 10, 5, 12, 5, 4, 12, 4, 8, 12, 8, 3, 12, 3, 0, 12, 0, 9, 12, 9, 1, 12, 1, 2 },
@ -1892,6 +2087,9 @@ static const char tiling13_3[2][12][30] = {
/* 4,5 */ { 6, 5, 10, 4, 7, 12, 9, 4, 12, 1, 9, 12, 2, 1, 12, 11, 2, 12, 3, 11, 12, 0, 3, 12, 8, 0, 12, 7, 8, 12 },
/* 4,6 */ { 2, 3, 11, 0, 1, 12, 8, 0, 12, 7, 8, 12, 6, 7, 12, 10, 6, 12, 5, 10, 12, 4, 5, 12, 9, 4, 12, 1, 9, 12 }
} };
return &tiling13_3[config][u][0];
}; // end of Tiling13_3
//_____________________________________________________________________________
/**
@ -1905,6 +2103,8 @@ static const char tiling13_3[2][12][30] = {
*/
//-----------------------------------------------------------------------------
/* 13.3 */
static const char* Tiling13_3_(unsigned char config, unsigned char u)
{
static const char tiling13_3_[2][12][30] = {
/* 165: 0, 2, 5, 7, */ {
/* 1,2 */ { 3, 2, 11, 8, 7, 12, 0, 8, 12, 1, 0, 12, 10, 1, 12, 6, 10, 12, 5, 6, 12, 9, 5, 12, 4, 9, 12, 7, 4, 12 },
@ -1934,6 +2134,9 @@ static const char tiling13_3_[2][12][30] = {
/* 4,5 */ { 6, 7, 11, 4, 5, 12, 8, 4, 12, 3, 8, 12, 2, 3, 12, 10, 2, 12, 1, 10, 12, 0, 1, 12, 9, 0, 12, 5, 9, 12 },
/* 4,6 */ { 10, 2, 1, 0, 3, 12, 9, 0, 12, 5, 9, 12, 6, 5, 12, 11, 6, 12, 7, 11, 12, 4, 7, 12, 8, 4, 12, 3, 8, 12 }
} };
return &tiling13_3_[config][u][0];
}; // end of Tiling13_3_
//_____________________________________________________________________________
/**
@ -1947,6 +2150,8 @@ static const char tiling13_3_[2][12][30] = {
*/
//-----------------------------------------------------------------------------
/* 13.4 */
static const char* Tiling13_4(unsigned char config, unsigned int u)
{
static const char tiling13_4[2][4][36] = {
/* 165: 0, 2, 5, 7, */ {
/* 1,2,6 */ { 12, 2, 10, 12, 10, 5, 12, 5, 6, 12, 6, 11, 12, 11, 7, 12, 7, 4, 12, 4, 8, 12, 8, 3, 12, 3, 0, 12, 0, 9, 12, 9, 1, 12, 1, 2 },
@ -1960,6 +2165,9 @@ static const char tiling13_4[2][4][36] = {
/* 2,3,5 */ { 10, 2, 12, 5, 10, 12, 6, 5, 12, 11, 6, 12, 7, 11, 12, 4, 7, 12, 8, 4, 12, 3, 8, 12, 0, 3, 12, 9, 0, 12, 1, 9, 12, 2, 1, 12 },
/* 3,4,6 */ { 12, 1, 9, 12, 9, 4, 12, 4, 5, 12, 5, 10, 12, 10, 6, 12, 6, 7, 12, 7, 11, 12, 11, 2, 12, 2, 3, 12, 3, 8, 12, 8, 0, 12, 0, 1 }
} };
return &tiling13_4[config][u][0];
}; // end of Tiling13_4
//_____________________________________________________________________________
/**
@ -1974,6 +2182,8 @@ static const char tiling13_4[2][4][36] = {
*/
//-----------------------------------------------------------------------------
/* 13.5.1 */
static const char* Tiling13_5_1(unsigned char config, int u)
{
static const char tiling13_5_1[2][4][18] = {
/* 165: 0, 2, 5, 7, */ {
/* 1,2,5 */ { 7, 6, 11, 1, 0, 9, 10, 3, 2, 3, 10, 5, 3, 5, 8, 4, 8, 5 },
@ -1987,6 +2197,8 @@ static const char tiling13_5_1[2][4][18] = {
/* 2,3,6 */ { 0, 1, 9, 6, 7, 11, 2, 3, 10, 5, 10, 3, 8, 5, 3, 5, 8, 4 },
/* 3,4,5 */ { 6, 5, 10, 0, 3, 8, 9, 2, 1, 2, 9, 4, 2, 4, 11, 7, 11, 4 }
} };
return &tiling13_5_1[config][u][0];
}; // end of Tiling13_5_1
//_____________________________________________________________________________
/**
@ -2000,6 +2212,8 @@ static const char tiling13_5_1[2][4][18] = {
*/
//-----------------------------------------------------------------------------
/* 13.5.2 */
static const char* Tiling13_5_2(unsigned char config, int u)
{
static const char tiling13_5_2[2][4][30] = {
/* 165: 0, 2, 5, 7, */ {
/* 1,2,5 */ { 1, 0, 9, 7, 4, 8, 7, 8, 3, 7, 3, 11, 2, 11, 3, 11, 2, 10, 11, 10, 6, 5, 6, 10, 6, 5, 7, 4, 7, 5 },
@ -2013,10 +2227,11 @@ static const char tiling13_5_2[2][4][30] = {
/* 2,3,6 */ { 6, 7, 11, 10, 2, 1, 5, 10, 1, 9, 5, 1, 5, 9, 4, 8, 4, 9, 0, 8, 9, 8, 0, 3, 1, 3, 0, 3, 1, 2 },
/* 3,4,5 */ { 0, 3, 8, 6, 7, 11, 6, 11, 2, 6, 2, 10, 1, 10, 2, 10, 1, 9, 10, 9, 5, 5, 9, 4, 5, 4, 6, 7, 6, 4 }
} };
return &tiling13_5_2[config][u][0];
}; // end of Tiling13_5_2
//_____________________________________________________________________________
//_____________________________________________________________________________
/**
* \brief tiling table for case 14
@ -2028,6 +2243,8 @@ static const char tiling13_5_2[2][4][30] = {
* A minus sign means to invert the result of the test.
*/
//-----------------------------------------------------------------------------
static const char* Tiling14(unsigned char config)
{
static const char tiling14[12][12] = {
/* 71: 0, 1, 2, 6, */ { 5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8 },
/* 43: 0, 1, 3, 5, */ { 2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5 },
@ -2042,6 +2259,8 @@ static const char tiling14[12][12] = {
/* 212: 2, 4, 6, 7, */ { 2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8 },
/* 184: 3, 4, 5, 7, */ { 5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2 }
};
return &tiling14[config][0];
}; // end of Tiling14
//_____________________________________________________________________________
@ -2057,6 +2276,8 @@ static const char tiling14[12][12] = {
* the cube is not.
*/
//-----------------------------------------------------------------------------
static const char CasesClassic(unsigned char u, unsigned char w)
{
static const char casesClassic[256][16] = {
/* 0: */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
/* 1: 0, */ { 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
@ -2315,8 +2536,14 @@ static const char casesClassic[256][16] = {
/* 254: 1, 2, 3, 4, 5, 6, 7, */ { 0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
/* 255: 0, 1, 2, 3, 4, 5, 6, 7, */ { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }
};
return casesClassic[u][w];
}; // end of CasesClassic
//_____________________________________________________________________________
}; // end of class EMCLookUpTable
}; // end of namespace tri
}; //end of namespace vcg
#endif // _LOOKUPTABLE_H_
#endif // __VCG_MC_LOOK_UP_TABLE