-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into svg-renderer
- Loading branch information
Showing
72 changed files
with
5,770 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,10 @@ Created by tvl ([email protected]) on 05-12-2019 | |
|
||
namespace cartocrow { | ||
|
||
Color::Color() : r(0), g(0), b(0) {} | ||
Color::Color(int r, int g, int b) : r(r), g(g), b(b) {} | ||
Color::Color(int rgb) : r((rgb & 0xff0000) >> 16), g((rgb & 0x00ff00) >> 8), b(rgb & 0x0000ff) {} | ||
|
||
Number<Inexact> wrapAngle(Number<Inexact> alpha, Number<Inexact> beta) { | ||
return wrap<Inexact>(alpha, beta, beta + M_2xPI); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ Created by tvl ([email protected]) on 07-11-2019 | |
#include <CGAL/Bbox_2.h> | ||
#include <CGAL/Circle_2.h> | ||
#include <CGAL/Exact_predicates_exact_constructions_kernel.h> | ||
#include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h> | ||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> | ||
#include <CGAL/Line_2.h> | ||
#include <CGAL/Point_2.h> | ||
|
@@ -60,6 +61,8 @@ template <class K> using Line = CGAL::Line_2<K>; | |
template <class K> using Segment = CGAL::Segment_2<K>; | ||
/// A ray in the plane. See \ref CGAL::Ray_2. | ||
template <class K> using Ray = CGAL::Ray_2<K>; | ||
/// An axis-aligned rectangle in the plane. See \ref CGAL::Iso_rectangle_2. | ||
template <class K> using Rectangle = CGAL::Iso_rectangle_2<K>; | ||
|
||
/// A polygon in the plane. See \ref CGAL::Polygon_2. | ||
template <class K> using Polygon = CGAL::Polygon_2<K>; | ||
|
@@ -170,6 +173,12 @@ struct Color { | |
int g; | ||
/// Blue component (integer 0-255). | ||
int b; | ||
/// Constructs the color black. | ||
Color(); | ||
/// Constructs a color. | ||
Color(int r, int g, int b); | ||
/// Constructs a color from a single integer (useful combined with hexadecimal literals, e.g. 0xFFFFFF). | ||
Color(int rgb); | ||
}; | ||
|
||
/// Wraps the given number \f$n\f$ to the interval \f$[a, b)\f$. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "function_painting.h" | ||
|
||
namespace cartocrow::renderer { | ||
FunctionPainting::FunctionPainting(const std::function<void(GeometryRenderer&)>& draw_function) | ||
: m_draw_function(draw_function) {} | ||
|
||
void FunctionPainting::paint(GeometryRenderer& renderer) const { | ||
m_draw_function(renderer); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef CARTOCROW_FUNCTION_PAINTING_H | ||
#define CARTOCROW_FUNCTION_PAINTING_H | ||
|
||
#include "geometry_renderer.h" | ||
#include "geometry_painting.h" | ||
|
||
namespace cartocrow::renderer { | ||
class FunctionPainting : public GeometryPainting { | ||
public: | ||
FunctionPainting(const std::function<void(GeometryRenderer&)>& draw_function); | ||
void paint(renderer::GeometryRenderer& renderer) const override; | ||
|
||
private: | ||
const std::function<void(GeometryRenderer&)> m_draw_function; | ||
}; | ||
} | ||
|
||
#endif //CARTOCROW_FUNCTION_PAINTING_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
set(SOURCES | ||
cat_point.cpp | ||
types.cpp | ||
parse_input.cpp | ||
patterns/pattern.cpp | ||
patterns/single_point.cpp | ||
patterns/matching.cpp | ||
patterns/island.cpp | ||
patterns/bank.cpp | ||
dilated/dilated_poly.cpp | ||
helpers/approximate_convex_hull.cpp | ||
helpers/cs_curve_helpers.cpp | ||
helpers/cs_polygon_helpers.cpp | ||
helpers/cs_polyline_helpers.cpp | ||
helpers/poly_line_gon_intersection.cpp | ||
partition_algorithm.cpp | ||
partition_painting.cpp | ||
drawing_algorithm.cpp | ||
grow_circles.cpp | ||
) | ||
set(HEADERS | ||
types.h | ||
settings.h | ||
cat_point.h | ||
parse_input.h | ||
patterns/pattern.h | ||
patterns/poly_pattern.h | ||
patterns/single_point.h | ||
patterns/matching.h | ||
patterns/island.h | ||
patterns/bank.h | ||
dilated/dilated_poly.h | ||
helpers/approximate_convex_hull.h | ||
helpers/arrangement_helpers.h | ||
helpers/point_voronoi_helpers.h | ||
helpers/poly_line_gon_intersection.h | ||
helpers/cropped_voronoi.h | ||
helpers/cs_curve_helpers.h | ||
helpers/cs_polygon_helpers.h | ||
helpers/cs_polyline_helpers.h | ||
partition_algorithm.h | ||
partition_painting.h | ||
partition.h | ||
drawing_algorithm.h | ||
general_polyline.h | ||
grow_circles.h | ||
) | ||
|
||
add_library(simplesets ${SOURCES}) | ||
target_link_libraries(simplesets | ||
PUBLIC core | ||
) | ||
|
||
cartocrow_install_module(simplesets) | ||
install(FILES ${HEADERS} DESTINATION ${CARTOCROW_INSTALL_DIR}/simplesets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "cat_point.h" | ||
|
||
namespace cartocrow::simplesets { | ||
std::ostream& operator<<(std::ostream& os, CatPoint const& catPoint) { | ||
return os << catPoint.category << " " << catPoint.point; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef CARTOCROW_CAT_POINT_H | ||
#define CARTOCROW_CAT_POINT_H | ||
|
||
#include "types.h" | ||
|
||
namespace cartocrow::simplesets { | ||
/// Categorical point | ||
struct CatPoint { | ||
unsigned int category; | ||
Point<Inexact> point; | ||
CatPoint(unsigned int category, Point<Inexact> point) : category(category), point(point) {}; | ||
bool operator==(const CatPoint&) const = default; | ||
}; | ||
|
||
std::ostream& operator<<(std::ostream& os, CatPoint const& catPoint); | ||
} | ||
|
||
#endif //CARTOCROW_CAT_POINT_H |
Oops, something went wrong.