| 123 | using namespace TriangleWrapperHelper; |
| 124 | |
| 125 | void TriangleWrapper::run() { |
| 126 | const size_t dim = m_points.cols(); |
| 127 | std::string flags = generate_command_line_options(); |
| 128 | |
| 129 | if (dim == 2) { |
| 130 | process_2D_input(flags); |
| 131 | } else if (dim == 3) { |
| 132 | DimReduction<3, 2> reductor(m_points); |
| 133 | |
| 134 | m_points = reductor.project(m_points); |
| 135 | if (m_holes.rows() > 0) { |
| 136 | assert(m_holes.cols() == 3); |
| 137 | m_holes = reductor.project(m_holes); |
| 138 | } |
| 139 | process_2D_input(flags); |
| 140 | |
| 141 | m_vertices = reductor.unproject(m_vertices); |
| 142 | } else { |
| 143 | std::stringstream err_msg; |
| 144 | err_msg << "Unsupported dim: " << dim; |
| 145 | throw NotImplementedError(err_msg.str()); |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | std::string TriangleWrapper::generate_command_line_options() const { |
| 150 | // Basic flag: |
no test coverage detected