/// \todo move this function into an include
  bool is_mesh_valid(Polyhedron *pMesh) {
    if (!pMesh->is_closed())
    {
      QMessageBox msgBox;
      msgBox.setText("The mesh is not closed.");
      msgBox.exec();
      return false;
    }
    if (!pMesh->is_pure_triangle())
    {
      QMessageBox msgBox;
      msgBox.setText("The mesh is not a pure triangle mesh.");
      msgBox.exec();
      return false;
    }

    // the algorithm is only applicable on a mesh
    // that has only one connected component
    std::size_t num_component;
    CGAL::Counting_output_iterator output_it(&num_component);
    CGAL::internal::corefinement::extract_connected_components(*pMesh, output_it);
    ++output_it;
    if (num_component != 1)
    {
      QMessageBox msgBox;
      QString str = QString("The mesh is not a single closed mesh.\n It has %1 components.").arg(num_component);
      msgBox.setText(str);
      msgBox.exec();
      return false;
    }
    return true;
  }
コード例 #2
0
ファイル: stream_util.hpp プロジェクト: planaria/kumori
	inline void forward(std::istream& input_stream, std::ostream& output_stream)
	{
		std::istreambuf_iterator<char> input_begin(input_stream);
		std::istreambuf_iterator<char> input_end;
		std::ostreambuf_iterator<char> output_it(output_stream);
		std::copy(input_begin, input_end, output_it);
	}
コード例 #3
0
ファイル: stream_util.hpp プロジェクト: planaria/kumori
	inline void forward(std::istream& input_stream, std::ostream& output_stream, std::streamsize size)
	{
		std::istreambuf_iterator<char> input_it(input_stream);
		std::ostreambuf_iterator<char> output_it(output_stream);

		while (size-- > 0)
			*output_it++ = *input_it++;
	}