/** * @file graphicsAlg.h * * @auhtor Remus Claudiu Dumitru * @date 18 Feb 2012 * */ #ifndef GRAPHICSALG_H_ #define GRAPHICSALG_H_ //============================================================================== // Includes //============================================================================== #include "model/plane3d.h" #include #include #include #include #include #include #include #include #include #include namespace model { class GraphicsAlg { private: typedef double Type; typedef CGAL::Simple_cartesian SC; typedef CGAL::Filtered_kernel K; typedef CGAL::Alpha_shape_euclidean_traits_2 Gt; typedef CGAL::Alpha_shape_vertex_base_2 Avb; typedef CGAL::Triangulation_hierarchy_vertex_base_2 Av; typedef CGAL::Triangulation_face_base_2 Tf; typedef CGAL::Alpha_shape_face_base_2 Af; typedef CGAL::Triangulation_default_data_structure_2 Tds; typedef CGAL::Delaunay_triangulation_2 Dt; typedef CGAL::Triangulation_hierarchy_2
Ht; /** * Computes the alpha edges. */ template static void alpha_edges(InputIterator begin, InputIterator end, const Type& Alpha, bool mode, OutputIterator out); public: typedef CGAL::Alpha_shape_2 Alpha_shape_2; typedef K::Point_2 Point; typedef K::Segment_2 Segment; typedef Alpha_shape_2::Face Face; typedef Alpha_shape_2::Vertex Vertex; typedef Alpha_shape_2::Edge Edge; typedef Alpha_shape_2::Face_handle Face_handle; typedef Alpha_shape_2::Vertex_handle Vertex_handle; typedef Alpha_shape_2::Face_circulator Face_circulator; typedef Alpha_shape_2::Vertex_circulator Vertex_circulator; typedef Alpha_shape_2::Locate_type Locate_type; typedef Alpha_shape_2::Face_iterator Face_iterator; typedef Alpha_shape_2::Vertex_iterator Vertex_iterator; typedef Alpha_shape_2::Edge_iterator Edge_iterator; typedef Alpha_shape_2::Edge_circulator Edge_circulator; typedef Alpha_shape_2::Alpha_iterator Alpha_iterator; typedef Alpha_shape_2::Alpha_shape_edges_iterator Alpha_shape_edges_iterator; /** * Sort planes HORIZONTALLY in a clockwise order, around the center of mass. * @warning in place sort */ static void clockwiseSort(std::vector& planes); /** * Computes the HORIZONTAL convex hull of the given planes. */ static std::vector getConcaveHull(std::vector planes); /** * Computes the discrete line between two points using Bresenham's algorithm. * @param src the source point * @param dest the destination point * @param precision the precision at which the discrete line shall be drawn */ static void getDiscreteLine(model::Point3d src, model::Point3d dest, double precision, const double& extraDist, std::vector& line); }; } /* namespace model */ #endif /* GRAPHICSALG_H_ */