Skip to content

Commit

Permalink
Simplify header
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrzeczkowicz committed Dec 27, 2022
1 parent d465b0f commit c009d0f
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 13 deletions.
1 change: 1 addition & 0 deletions bridge.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "header.hpp"
#include "raster.hpp"

#include <CGAL/boost/graph/Face_filtered_graph.h>
#include <CGAL/Polygon_mesh_processing/locate.h>
#include <Eigen/SparseQR>

Expand Down
4 changes: 4 additions & 0 deletions code.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "header.hpp"
#include "raster.hpp"

#include <regex>
#include <unordered_map>

#include <ogrsf_frmts.h>
#include <CGAL/IO/WKT.h>
#include <CGAL/boost/graph/copy_face_graph.h>

Expand Down
2 changes: 2 additions & 0 deletions edge_collapse.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "header.hpp"
#include "raster.hpp"

#include <chrono>

#include <CGAL/Surface_mesh_simplification/edge_collapse.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Count_stop_predicate.h>
Expand Down
13 changes: 1 addition & 12 deletions header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,18 @@
#include <stdexcept>
#include <sstream>
#include <stdlib.h>
#include <getopt.h>
#include <string>
#include <list>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <chrono>
#include <regex>
#include <unordered_map>
#include <limits>

#include "ogrsf_frmts.h"
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/Polygon_with_holes_2.h>
#include <CGAL/boost/graph/Face_filtered_graph.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arrangement_2.h>
#include <CGAL/Straight_skeleton_2.h>

#include "label.hpp"
Expand All @@ -37,8 +28,6 @@ typedef CGAL::Surface_mesh<Point_3> Surface_mesh;
typedef CGAL::Polygon_2<K> Polygon;

typedef CGAL::Exact_predicates_inexact_constructions_kernel Exact_predicates_kernel;
typedef CGAL::Arr_segment_traits_2<Exact_predicates_kernel> Traits_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;

/// A point on a skeleton
struct skeletonPoint {
Expand Down Expand Up @@ -77,4 +66,4 @@ struct skeletonPoint {
}
};

#endif /* !HEADER_H_ */
#endif /* !HEADER_H_ */
2 changes: 1 addition & 1 deletion label.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ static std::array<Label, 11> LABELS {
Label(10, "swimming pool", 50, 150, 250)
};

#endif /* !LABEL_H_ */
#endif /* !LABEL_H_ */
2 changes: 2 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "header.hpp"
#include "raster.hpp"

#include <getopt.h>

void save_mesh(const Surface_mesh &mesh, const Raster &raster, const char *filename);

std::tuple<Surface_mesh, Surface_mesh> compute_meshes(const Raster &raster);
Expand Down
6 changes: 6 additions & 0 deletions path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
#include "raster.hpp"

#include <CGAL/boost/graph/copy_face_graph.h>
#include <CGAL/boost/graph/Face_filtered_graph.h>
#include <CGAL/Polyline_simplification_2/simplify.h>
#include <CGAL/create_straight_skeleton_from_polygon_with_holes_2.h>
#include <CGAL/Straight_skeleton_converter_2.h>
#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arrangement_2.h>

typedef CGAL::Arr_segment_traits_2<Exact_predicates_kernel> Traits_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;

void save_mesh(const Surface_mesh &mesh, const Raster &raster, const char *filename);

Expand Down
2 changes: 2 additions & 0 deletions raster.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "raster.hpp"

#include <gdal_priv.h>

std::pair<int,int> Raster::grid_conversion(int P, int L, double grid_to_crs[6], OGRCoordinateTransformation *crs_to_other_crs, double other_grid_to_other_crs[6]) {
double x = grid_to_crs[0] + (0.5 + P)*grid_to_crs[1] + (0.5 + L)*grid_to_crs[2];
double y = grid_to_crs[3] + (0.5 + P)*grid_to_crs[4] + (0.5 + L)*grid_to_crs[5];
Expand Down
1 change: 1 addition & 0 deletions raster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define RASTER_H_

#include "header.hpp"
#include <ogr_spatialref.h>

class Raster {
public:
Expand Down

0 comments on commit c009d0f

Please sign in to comment.