compile tutorial with namespace

This commit is contained in:
Alec Jacobson
2015-06-17 11:25:29 -04:00
parent 83c77cbb5d
commit 6643b9a67c
50 changed files with 328 additions and 290 deletions
+12 -11
View File
@@ -9,7 +9,8 @@
Eigen::MatrixXd VA,VB,VC;
Eigen::VectorXi J;
Eigen::MatrixXi FA,FB,FC;
igl::MeshBooleanType boolean_type(igl::MESH_BOOLEAN_TYPE_UNION);
igl::boolean::MeshBooleanType boolean_type(
igl::boolean::MESH_BOOLEAN_TYPE_UNION);
const char * MESH_BOOLEAN_TYPE_NAMES[] =
{
@@ -20,9 +21,9 @@ const char * MESH_BOOLEAN_TYPE_NAMES[] =
"Resolve",
};
void update(igl::Viewer &viewer)
void update(igl::viewer::Viewer &viewer)
{
igl::mesh_boolean(VA,FA,VB,FB,boolean_type,VC,FC,J);
igl::boolean::mesh_boolean(VA,FA,VB,FB,boolean_type,VC,FC,J);
Eigen::MatrixXd C(FC.rows(),3);
for(size_t f = 0;f<C.rows();f++)
{
@@ -39,7 +40,7 @@ void update(igl::Viewer &viewer)
viewer.data.set_colors(C);
}
bool key_down(igl::Viewer &viewer, unsigned char key, int mods)
bool key_down(igl::viewer::Viewer &viewer, unsigned char key, int mods)
{
switch(key)
{
@@ -47,14 +48,14 @@ bool key_down(igl::Viewer &viewer, unsigned char key, int mods)
return false;
case '.':
boolean_type =
static_cast<igl::MeshBooleanType>(
(boolean_type+1)% igl::NUM_MESH_BOOLEAN_TYPES);
static_cast<igl::boolean::MeshBooleanType>(
(boolean_type+1)% igl::boolean::NUM_MESH_BOOLEAN_TYPES);
break;
case ',':
boolean_type =
static_cast<igl::MeshBooleanType>(
(boolean_type+igl::NUM_MESH_BOOLEAN_TYPES-1)%
igl::NUM_MESH_BOOLEAN_TYPES);
static_cast<igl::boolean::MeshBooleanType>(
(boolean_type+igl::boolean::NUM_MESH_BOOLEAN_TYPES-1)%
igl::boolean::NUM_MESH_BOOLEAN_TYPES);
break;
case '[':
viewer.core.camera_dnear -= 0.1;
@@ -64,7 +65,7 @@ bool key_down(igl::Viewer &viewer, unsigned char key, int mods)
return true;
}
std::cout<<"A "<<MESH_BOOLEAN_TYPE_NAMES[boolean_type]<<" B."<<std::endl;
igl::mesh_boolean(VA,FA,VB,FB,boolean_type,VC,FC);
igl::boolean::mesh_boolean(VA,FA,VB,FB,boolean_type,VC,FC);
update(viewer);
return true;
}
@@ -76,7 +77,7 @@ int main(int argc, char *argv[])
igl::readOFF("../shared/cheburashka.off",VA,FA);
igl::readOFF("../shared/decimated-knight.off",VB,FB);
// Plot the mesh with pseudocolors
igl::Viewer viewer;
igl::viewer::Viewer viewer;
// Initialize
update(viewer);