11 #include <boost/spirit/include/qi.hpp>
13 #include <boost/bind.hpp>
15 #include "../MeshGenerator.hpp"
19 namespace qi = boost::spirit::qi;
20 namespace spirit = boost::spirit;
24 std::cerr <<
"Hey there!" << c++ << std::endl;
27 template <
typename Iterator>
31 netgen_grammar::base_type(content),
32 generator_(_generator) {
34 content = node_section_header >> *node >>
35 element_section_header >> *element >>
36 face_section_header >> *face;
38 node_section_header = qi::int_ >> spirit::eol;
40 node = *space >> qi::double_[
boost::bind(&MeshGenerator::add_vertex_component, &generator_, ::_1)] >>
41 *space >> qi::double_[
boost::bind(&MeshGenerator::add_vertex_component, &generator_, ::_1)] >>
42 *space >> qi::double_[
boost::bind(&MeshGenerator::add_vertex_component, &generator_, ::_1)] >> spirit::eol;
44 element_section_header = qi::int_[
boost::bind(&MeshGenerator::set_num_cells, &generator_, ::_1)] >>
47 element = *space >> qi::int_ >>
48 *space >> qi::int_[
boost::bind(&MeshGenerator::add_cell_vertex, &generator_, ::_1)] >>
49 *space >> qi::int_[
boost::bind(&MeshGenerator::add_cell_vertex, &generator_, ::_1)] >>
50 *space >> qi::int_[
boost::bind(&MeshGenerator::add_cell_vertex, &generator_, ::_1)] >>
51 *space >> qi::int_[
boost::bind(&MeshGenerator::add_cell_vertex, &generator_, ::_1)] >>
54 face_section_header = qi::int_ >> spirit::eol;
56 face = *space >> qi::int_ >>
62 space = spirit::ascii::space - spirit::eol;
67 qi::rule<Iterator> node_section_header, element_section_header, face_section_header,
68 node, element, face, space, content;
bool bind(osg::GeometryPtr &_geo, Mesh &_mesh)