use argc/argv to pass the argument

This commit is contained in:
Andreas Fabri 2014-06-13 09:51:31 +02:00
parent f531ee2fa9
commit 9170b0a866
8 changed files with 16 additions and 15 deletions

View File

@ -0,0 +1 @@
cube.off

View File

@ -18,12 +18,10 @@ typedef boost::graph_traits<Polyhedron>::vertex_iterator vertex_iterator;
int main() {
int main(int argc, char** argv) {
Polyhedron P;
std::ifstream in("cube.off");
Polyhedron P;
std::ifstream in(argv[1]);
in >> P ;
// associate indices to the vertices using the "id()" field of the vertex.

View File

@ -0,0 +1 @@
cube.off

View File

@ -46,10 +46,10 @@ adjacent_vertices_V2(const Polyhedron& g,
}
int main()
int main(int argc, char** argv)
{
std::ifstream in(argv[1]);
Polyhedron P;
std::ifstream in("cube.off");
in >> P;
GraphTraits::vertex_iterator vi = vertices(P).first;
std::list<vertex_descriptor> V;

View File

@ -0,0 +1 @@
cube.off

View File

@ -69,19 +69,17 @@ void calculate_face_normals(const HalfedgeGraph& g,
}
}
int main()
int main(int argc, char** argv)
{
typedef boost::property_map<
Polyhedron,
CGAL::face_index_t
>::const_type Face_index_map;
std::ifstream in(argv[1]);
Polyhedron P;
{
std::ifstream in("cube.off");
in >> P ;
}
in >> P ;
// initialize facet indices
std::size_t i = 0;
for(Polyhedron::Facet_iterator it = P.facets_begin(); it != P.facets_end(); ++it, ++i)

View File

@ -0,0 +1 @@
cube.off

View File

@ -38,10 +38,11 @@ struct Source {
}
};
int main()
int main(int argc, char** argv)
{
std::ifstream in(argv[1]);
Polyhedron P;
std::cin >> P;
in >> P;
GraphTraits::vertex_descriptor vd = *(vertices(P).first);
typedef boost::transform_iterator<Source<Polyhedron>,halfedge_around_target_iterator> adjacent_vertex_iterator;