From d102501ac54ca780189a342e7d1cd1f8f17ca376 Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Wed, 29 Apr 2020 15:09:47 -0400 Subject: [PATCH] Remove unused parameters --- src/csg/impl/parser.cpp | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/csg/impl/parser.cpp b/src/csg/impl/parser.cpp index a6cd4b1..e01b291 100644 --- a/src/csg/impl/parser.cpp +++ b/src/csg/impl/parser.cpp @@ -134,8 +134,7 @@ template struct action {}; template <> struct action { template - static void apply(const Input &in, parser_state &st) { - // std::cout << " { " << std::endl; + static void apply0(parser_state &st) { std::vector new_group; st.current_objs.push_back(new_group); } @@ -143,8 +142,7 @@ template <> struct action { template <> struct action { template - static void apply(const Input &in, parser_state &st) { - // std::cout << " } " << std::endl; + static void apply0(parser_state &st) { st.current_group.clear(); for (auto obj : st.current_objs.back()) { st.current_group.push_back(obj); @@ -165,7 +163,7 @@ template <> struct action { template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { st.current_matrices.push_back(st.current_matrix); st.current_matrix.clear(); } @@ -173,7 +171,7 @@ template <> struct action { template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { st.current_matrix.push_back(st.current_vec); st.current_vec.clear(); } @@ -189,35 +187,35 @@ void add_group(parser_state &st) { template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { add_group(st); } }; template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { add_group(st); } }; template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { add_group(st); } }; template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { add_group(st); } }; template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { auto csg_in = csg::Intersection(); for (const auto &curr_obj : st.current_group) { csg_in.objs.push_back(curr_obj); @@ -228,7 +226,7 @@ template <> struct action { template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { auto csg_diff = csg::Difference(); for (auto it = st.current_group.begin(); it != st.current_group.end(); ++it) { @@ -244,7 +242,7 @@ template <> struct action { template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { auto mulmat = csg::Mulmatrix(); auto mat = st.current_matrices.back(); // clang-format off @@ -269,7 +267,7 @@ template <> struct action { template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { csg::Cube cub; auto size = std::get>(st.curr_attr["size"]); cub.size = {size[0], size[1], size[2]}; @@ -282,7 +280,7 @@ template <> struct action { template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { if (st.curr_attr.count("r")) { // proper cylinder if (st.curr_attr.count("r1") || st.curr_attr.count("r2")) { @@ -311,7 +309,7 @@ template <> struct action { template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { csg::Sphere sph; sph.radius = std::get(st.curr_attr["r"]); @@ -350,21 +348,21 @@ template <> struct action { template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { st.curr_attr[st.current_name] = true; } }; template <> struct action { template - static void apply(const Input &in, parser_state &st) { - st.curr_attr[st.current_name] = false; + static void apply0(parser_state &st) { + st.curr_attr[st.current_name] = 42; } }; template <> struct action { template - static void apply(const Input &in, parser_state &st) { + static void apply0(parser_state &st) { st.curr_attr[st.current_name] = st.current_vec; st.current_vec.clear(); } -- GitLab