Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gsoc2023, stand-alone interactive program that demonstrates 2D arrangements embedded on the sphere #7678

Merged
merged 234 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 187 commits
Commits
Show all changes
234 commits
Select commit Hold shift + click to select a range
c1c1a51
Merge branch 'Aos_2-conics-efif' into gsoc2023-aos_sphere_demo-denizd…
efifogel May 10, 2023
c74d7a3
Merge branch 'master' into gsoc2023-aos_sphere_demo-denizdiktas
efifogel May 24, 2023
f9b9591
Fixed some approximate operators
efifogel May 26, 2023
9720911
Ops (Approximate_point_2)
efifogel May 26, 2023
facc592
Fixed dependencies. (Moved Arr_extended_direction_3 definition to the…
efifogel May 27, 2023
2159476
Fixed Approxinate_2::operator()(const Point_2&)
efifogel May 29, 2023
f08da84
1st revision
efifogel Oct 2, 2022
a079b5d
Initial implementation of the approximation-function inside Approxima…
denizdiktas May 30, 2023
910e043
changed the error type in the approximation function from double to A…
denizdiktas May 30, 2023
01e6057
Fixed approximation of arcs with theta>PI: atan2 was returning negati…
denizdiktas May 30, 2023
7a447d6
Code clean-up and style corrections
denizdiktas Jun 1, 2023
fc9c993
Added std:: in front of math functions
denizdiktas Jun 1, 2023
34b9a7d
Removed std::vector from the algorithm, now outputting the approximat…
denizdiktas Jun 1, 2023
e55287a
Started to add tests for the Approximate_2 traits functor
efifogel Jun 1, 2023
d565320
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
efifogel Jun 1, 2023
ab6b892
Added tests for the Approximate_2 functor
efifogel Jun 1, 2023
da710d6
Fixed test expected result
efifogel Jun 2, 2023
0477dfe
Removed unnecessary (actually erroneous) member function definitions
efifogel Jun 2, 2023
81d4592
style corrections
denizdiktas Jun 2, 2023
3ade612
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
efifogel Jun 3, 2023
890395a
Demo app with just sphere drawn inside OpenGL with GGG (but cmake fai…
denizdiktas Jun 5, 2023
2864d74
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
denizdiktas Jun 5, 2023
cbafb4e
Switched from GGG to Qt6: current demo just draws a single triangle
denizdiktas Jun 5, 2023
2f202dd
demo-earth: added dynamic rotation and static camera location
denizdiktas Jun 5, 2023
52f4c7e
Rendering a sphere with flat shading: triangle normals are calculate …
denizdiktas Jun 5, 2023
9369e15
Sphere Drawing Skeleton: add vertex positions and normals to a single…
denizdiktas Jun 7, 2023
3737f3a
fixed the sphere problem by generating the strided vertex-data separa…
denizdiktas Jun 7, 2023
6acd902
applied coding conventions
denizdiktas Jun 7, 2023
ce02ab6
Added support for drawing an arrangement on a sphere induced by geode…
efifogel Jun 7, 2023
d4ee1bb
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
efifogel Jun 7, 2023
0712485
smooth sphere shading + minor style corrections
denizdiktas Jun 9, 2023
b0a2e09
refactor: separated Sphere into its separate class
denizdiktas Jun 9, 2023
7ffda35
reverted back commented out statement
efifogel Jun 11, 2023
99fd1e3
Added camera controls (needs refactoring)
denizdiktas Jun 12, 2023
9f404ab
Added Camera class & code refactor
denizdiktas Jun 12, 2023
cbf97e9
Refactor: Camera class
denizdiktas Jun 12, 2023
eb03e6b
Refactor: moved Sphere to a separate file
denizdiktas Jun 12, 2023
609a13e
Refactor: Shader_program added as an abstraction
denizdiktas Jun 12, 2023
84aa351
Refactor: shaders can be read from file
denizdiktas Jun 12, 2023
2ee3832
Added: camera-zoom
denizdiktas Jun 13, 2023
e4840f5
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
efifogel Jun 13, 2023
21323d8
Added merdians
efifogel Jun 13, 2023
1c98dba
small code refactor
denizdiktas Jun 13, 2023
42cc227
Added sphere color
denizdiktas Jun 13, 2023
fc3bcaf
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
denizdiktas Jun 13, 2023
452cd88
Added: color-only shader
denizdiktas Jun 13, 2023
74b54a3
Added: world coordinate axes
denizdiktas Jun 13, 2023
9a5bfa0
Corrected initial camera position such that z-axis points to up, x-ax…
denizdiktas Jun 14, 2023
84f614a
Refactor: shader initialization
denizdiktas Jun 14, 2023
947d46c
Added CGAL to CMakeLists.txt
denizdiktas Jun 14, 2023
5808019
Added: test code for arc drawing (needs more work for generic version)
denizdiktas Jun 14, 2023
db222f0
z-fighting solved with silhouette plane
denizdiktas Jun 14, 2023
d3dc562
added separate shader for drawing arcs
denizdiktas Jun 15, 2023
f8ccbb1
Bug fix: arc-shader initialization
denizdiktas Jun 15, 2023
f483d1b
bug fix: position attribute stride was left at 3, set back 0 because …
denizdiktas Jun 15, 2023
96be82f
Added capability to render multiple arcs
denizdiktas Jun 15, 2023
2d7db03
sytling and other corrections
denizdiktas Jun 15, 2023
ff0a29d
warning messages fixed
denizdiktas Jun 15, 2023
eaece85
fixed shader loading program
denizdiktas Jun 15, 2023
b3d657d
intermediate camera fix (initial axes are not correct, this needs to …
denizdiktas Jun 16, 2023
493206e
now z-axis looks upwards
denizdiktas Jun 16, 2023
782d722
Added an alternative camera rotation (look inside the mouseMoveEvent(…
denizdiktas Jun 16, 2023
e87f5a5
Refactor: name changes and member variable fixes
denizdiktas Jun 16, 2023
d68e430
refactor
denizdiktas Jun 16, 2023
f9c98fe
Refactor: separated Geodesic arcs and their representation into diffe…
denizdiktas Jun 17, 2023
531399f
refactor
denizdiktas Jun 17, 2023
1e760f4
Added: computation of the world-space approximation error by back-pro…
denizdiktas Jun 19, 2023
a1af86f
Bug fixed: camera now rotates from the last zoom position
denizdiktas Jun 19, 2023
e815709
Corrected behavior of the camera manipulator (backprojected diff-vect…
denizdiktas Jun 19, 2023
76c9873
Started reading KML GIS file (code is unstable, do not use it yet!)
denizdiktas Jun 23, 2023
ffca665
added node conversion for kml-reader
denizdiktas Jun 24, 2023
520083f
Kml reader can read country data (Note: this is not a general reader!)
denizdiktas Jun 24, 2023
a7bbef7
World countries are rendered on the sphere
denizdiktas Jun 24, 2023
4f616f4
Refactor: removed std::string dependencies, using QString in KML-parser
denizdiktas Jun 24, 2023
b31d2d4
Added: code to check for duplicates
denizdiktas Jun 26, 2023
c5a7777
Added: code to render the repeated vertices
denizdiktas Jun 26, 2023
31cd58d
Added: Arrangement check code
denizdiktas Jun 28, 2023
10e7154
Added: check with extended DCEL
denizdiktas Jun 28, 2023
38c4146
Added: code to visualize the newly created vertices and to toggle the…
denizdiktas Jun 28, 2023
03e2234
refactor
denizdiktas Jun 29, 2023
e29175b
Rendering countries one by one
denizdiktas Jun 30, 2023
7571f9a
Implemented: rendering individual arcs to see the problem with the GI…
denizdiktas Jul 3, 2023
d97f1cf
Organized files under different categories in CMakeLists.txt
denizdiktas Jul 3, 2023
2b251e5
Changed: KML data structure to reflect the geometry correctly
denizdiktas Jul 3, 2023
1c934d7
Corrected the rendering and arrangement construction logic (TODO: we …
denizdiktas Jul 3, 2023
434c219
Moved arc construction into Aos as static (make it non-static member …
denizdiktas Jul 4, 2023
32446d3
Refactor: moved common arc construction code in Aos to anonymous name…
denizdiktas Jul 4, 2023
d5c4d3f
Implemented: check for problematic arc in Antarctica (looks like it i…
denizdiktas Jul 4, 2023
9f98df3
Refactor
denizdiktas Jul 5, 2023
7ba83df
Added: identification curve in the scene
denizdiktas Jul 7, 2023
daf548c
refactor
denizdiktas Jul 7, 2023
ea0604e
Implemented: defining polygons with node-ids
denizdiktas Jul 8, 2023
258b40a
Working on identifying the vertex problems
denizdiktas Jul 10, 2023
83d22ac
node-collapsing (very basic)
denizdiktas Jul 10, 2023
824d989
minor refactor
denizdiktas Jul 10, 2023
2d2174d
Added: code to check for problematic nodes in Africa region and verif…
denizdiktas Jul 11, 2023
19bb136
Refactor: moved shapefile reader to its own class
denizdiktas Jul 12, 2023
78cead6
minor refactor
denizdiktas Jul 12, 2023
e7db9ce
Refactor: moved camera rotation-manipulator to its own class
denizdiktas Jul 12, 2023
b800d9a
Refactor: moved basic gui-handling in Camera_manip_rot into Camera_manip
denizdiktas Jul 12, 2023
96c81a0
Refactor: camera manipulator bpa moved to its own class by deriving f…
denizdiktas Jul 13, 2023
8bbb43c
Refactor: camera manipulator for zoom moved to its own class
denizdiktas Jul 13, 2023
70247a1
clean-up
denizdiktas Jul 13, 2023
f7b1d16
Refactor: moved commonly calculated values in the manipulators up to …
denizdiktas Jul 14, 2023
92c6c17
Added: Timer class to time the computation of the approximation of co…
denizdiktas Jul 14, 2023
13111f4
Added: Message_manager to notify changes in zoom (trying to recompute…
denizdiktas Jul 17, 2023
a43389d
bug fix: confirmed that the previous opengl error was due to the inac…
denizdiktas Jul 17, 2023
9014f88
Initial implementation of checking the newly created faces during the…
denizdiktas Jul 17, 2023
302f36b
working on finding out the newly created faces in the arrangement
denizdiktas Jul 18, 2023
f5f0995
Finished: code to identify the newly created faces: previous approach…
denizdiktas Jul 18, 2023
3009fc4
Fixed: Antarctica in no longer identified as one of the newly created…
denizdiktas Jul 18, 2023
db132c3
commented out shapefile
denizdiktas Jul 23, 2023
39504e5
Added: JSON parser (with example)
denizdiktas Jul 24, 2023
c2f323b
saving the vertices and edges for now (intermediate commit)
denizdiktas Jul 24, 2023
38376c3
Added: correct code to traverse the outer and inner ccbs of all faces
denizdiktas Jul 25, 2023
95eb1f5
separating the geometry from topology: vertices -> points, edges -> …
denizdiktas Jul 25, 2023
a87fec0
Added: writing the halfedges
denizdiktas Jul 25, 2023
5a08d9a
added: writing of faces
denizdiktas Jul 26, 2023
ddaa233
minor refactor
denizdiktas Jul 28, 2023
1995b8b
corrections for saving the json file
denizdiktas Jul 28, 2023
7e7ff1a
Removed last trace of shp library
efifogel Jul 30, 2023
5ba1864
working on JSON-loading
denizdiktas Jul 30, 2023
454d2c3
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
denizdiktas Jul 30, 2023
47df8a8
Dropped the old database library; used json instead
efifogel Jul 31, 2023
16863d7
modified the arr-saving function
denizdiktas Aug 1, 2023
1db9651
not skipping the spherical face
denizdiktas Aug 1, 2023
c71362a
json parsing
efifogel Aug 1, 2023
7a8ed94
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
efifogel Aug 1, 2023
944ebe0
changed: saving edges instead of half-edges (code might need optimiza…
denizdiktas Aug 2, 2023
cd26c23
updated
efifogel Aug 6, 2023
d374cff
Fixed condition
efifogel Aug 7, 2023
249b412
modified file format
denizdiktas Aug 8, 2023
f80b980
added: initial triangulation code
denizdiktas Aug 10, 2023
dbd9511
initiali triangle visualization (triangles outside of the polygon are…
denizdiktas Aug 10, 2023
7254741
solved the triangulation error
denizdiktas Aug 10, 2023
64bafda
added anti z-fighting capability to smooth-shader
denizdiktas Aug 10, 2023
de4bf46
Updated
efifogel Aug 11, 2023
9c6c7ff
Allowed missing outer or inner ccbs in case not present
efifogel Aug 11, 2023
93811df
added: source and target attributes to each edge in json format
denizdiktas Aug 11, 2023
a4c56c9
added: 2 flags when recording the faces and code to check the smalles…
denizdiktas Aug 11, 2023
15a1b8f
fixed: curve source and target indices
denizdiktas Aug 11, 2023
66d0ef8
incorporated json reader from globe project
denizdiktas Aug 12, 2023
0c3ab6d
code cleanup
denizdiktas Aug 12, 2023
2493be1
added a single global static Geom_traits object in Aos.cpp for all op…
denizdiktas Aug 12, 2023
f1faa51
added copyright notices
denizdiktas Aug 12, 2023
1a6ed9a
Added face name
efifogel Aug 12, 2023
b40ea14
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
efifogel Aug 12, 2023
9e2c80b
Added: json loading by country name
denizdiktas Aug 13, 2023
ee279d4
grouped triangles by countries
denizdiktas Aug 13, 2023
d97d364
can render each country in different color now
denizdiktas Aug 13, 2023
08a695b
reduced color-set (neighboring countries got different colors from a …
denizdiktas Aug 13, 2023
3b8aa1d
reverted back to each country having a unique color (a little dimmed)
denizdiktas Aug 14, 2023
b028dca
started working on sphere-line intersection in GUI
denizdiktas Aug 14, 2023
88b2e91
bug fixed: sphere ray intersection
denizdiktas Aug 15, 2023
60a9ce2
Added: country selection
denizdiktas Aug 15, 2023
db65cfa
Fixed: memory leak with Country_aos arrangement (using std::shared_pt…
denizdiktas Aug 15, 2023
c2173dd
get_handle is now templated & minor cleanup
denizdiktas Aug 15, 2023
8d99ac3
refactor: moved Aos definitions to a separate file
denizdiktas Aug 15, 2023
544942e
refactor: moved triangulation code to a separate class
denizdiktas Aug 15, 2023
1015f04
minor refactor: redefined new_faces as member variable
denizdiktas Aug 16, 2023
bf4edb9
move verification code to a separate class (Verification)
denizdiktas Aug 16, 2023
ef68eb7
Lighting corrected
denizdiktas Aug 16, 2023
f8d58de
minor refactor: moved country picking to separate member function to …
denizdiktas Aug 16, 2023
f785ef7
refactor: added gui_event_handler base class & derived Camera_manip f…
denizdiktas Aug 17, 2023
ddc8cdd
refactor
denizdiktas Aug 17, 2023
706e7ea
refactor: moved country picking to a separate class
denizdiktas Aug 17, 2023
cec57f2
minor refactor: Aos::get_approx_arcs & added rendering of country bor…
denizdiktas Aug 17, 2023
0a10e28
the outlines of the faces are drawn from the arrangement data itself …
denizdiktas Aug 17, 2023
498778d
refactor: kept just the code related to the final application and mov…
denizdiktas Aug 18, 2023
a323352
minor refactor and clean-up on Main_widget
denizdiktas Aug 18, 2023
96145bf
refactor on Single_vertex: position is held inside this class now (no…
denizdiktas Aug 18, 2023
e85b593
added: if the query point is on the vertex or on the edge, then one o…
denizdiktas Aug 20, 2023
a7e3885
Added json database file and refered to it
efifogel Aug 29, 2023
a7f5685
fixed Qt warning message
denizdiktas Aug 29, 2023
41b7f69
added command line argument input
denizdiktas Aug 29, 2023
0f7bafb
liminated uses of deprecated Qt6 functions
efifogel Aug 30, 2023
12c8dec
Merge remote-tracking branch 'cgal/master' into gsoc2023-aos_sphere_d…
efifogel Aug 30, 2023
fb2a276
Added the new 'earth' demo
efifogel Aug 30, 2023
67405ff
Removed obsolete demo 'globus'
efifogel Aug 30, 2023
eb089b7
cleaned up
efifogel Aug 30, 2023
f2fd4d7
Merge branch 'master' into gsoc2023-aos_sphere_demo-denizdiktas
efifogel Sep 14, 2023
5df7ed2
Merge branch 'master' into gsoc2023-aos_sphere_demo-denizdiktas
efifogel Sep 20, 2023
5afcc24
Cleaned up
efifogel Sep 20, 2023
fff5fa5
cleaned up
efifogel Jan 8, 2024
36d23e8
Cleaned up; added default input file
efifogel Jan 8, 2024
13b22ab
Merge branch 'master' into gsoc2023-aos_sphere_demo-denizdiktas
efifogel Jan 8, 2024
a086c3b
Cleaned up the build
efifogel Jan 8, 2024
c865eed
Used Boost filesystem to enhance input verification
efifogel Jan 8, 2024
2c70c53
Cleaned up
efifogel Jan 8, 2024
e357e1a
ixed typo
efifogel Jan 8, 2024
f801cea
Ops, one more typo
efifogel Jan 16, 2024
ce59938
Merge remote-tracking branch 'cgal/master'
sloriot Feb 29, 2024
4aef906
Renamed the directory earth => Arrangement_on_surface_2_earth
efifogel Mar 1, 2024
3e50a5b
Cleaned up (removed unused variables and types; used std::size_t inst…
efifogel Mar 1, 2024
0b7859a
Added missing license
efifogel Mar 1, 2024
36a03f8
More cleanups
efifogel Mar 1, 2024
e545c67
Added description
efifogel Mar 1, 2024
5e6d16e
Pacify some compiler
efifogel Mar 1, 2024
7a406d1
fix warnings
sloriot Mar 1, 2024
aa47931
fix demo name
sloriot Mar 1, 2024
e1df935
rename data directory
sloriot Mar 1, 2024
01eb029
Fixed conversion
efifogel Mar 5, 2024
50052e8
Commented out install statement
efifogel Mar 5, 2024
e6d396a
Adopted some statements from the standard demo for the testsuit
efifogel Mar 5, 2024
2ef13a7
Removed "REQUIRED" from find_package(Qt6...) to enable testing withou…
efifogel Mar 9, 2024
9f226f5
Used size_t instead of int; removed unused variables; cleaned up
efifogel Mar 12, 2024
6164b2c
cleaned up
efifogel Mar 12, 2024
50a2ae0
Changed float to double
efifogel Mar 12, 2024
4be9a3c
Indented properly
efifogel Mar 12, 2024
046d655
Cleaned up
efifogel Mar 12, 2024
db5b8b0
Cleaned up and used GLsizei
efifogel Mar 12, 2024
8ab75b6
Cleaned up and changed int to size_t
efifogel Mar 12, 2024
a8cdcf9
remove tabs
sloriot Mar 12, 2024
0930058
get rid of filesystem
sloriot Mar 14, 2024
669e5bc
be quiet
sloriot Mar 14, 2024
326bdf7
be compatible with 6.2
sloriot Mar 14, 2024
d112498
warnings
sloriot Mar 15, 2024
e9603e6
Use CGAL::data_file_path()
afabri Mar 27, 2024
6a5cacf
Added CGAL::Data to the target tofind the input file automatically
efifogel Mar 27, 2024
ed9f712
specify that the data set is public domain
lrineau Mar 27, 2024
66cb981
use find package instead
sloriot Mar 28, 2024
c64c0a9
add minimal required version
sloriot Mar 28, 2024
af21bb2
Removed drawing for now
efifogel Mar 29, 2024
d060c19
Pacify MSVC (firxed some warnings related to type conversions)
efifogel Mar 29, 2024
b0b8e4c
Removed redundant comments and cleaned up
efifogel Mar 29, 2024
d0e72bb
Simplified the example
efifogel Apr 2, 2024
3ce1a3f
remove unused parameters
sloriot Apr 4, 2024
de93dad
hide unused variable
sloriot Apr 5, 2024
0de0692
Fixed construction of query point
efifogel Apr 15, 2024
5a7b89b
Suppress time events; fixed triangulation
efifogel Apr 15, 2024
89bfe4b
Merge remote-tracking branch 'cgal/master' into gsoc2023-aos_sphere_d…
efifogel Apr 15, 2024
92a2139
Added missing 'const'
efifogel Apr 15, 2024
eb330d6
Fixed artifact by adiing uniformly distributed generated points in th…
efifogel Apr 15, 2024
ec18666
fix warnings
sloriot Apr 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,868 changes: 1,868 additions & 0 deletions Arrangement_on_surface_2/demo/earth/Aos.cpp

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions Arrangement_on_surface_2/demo/earth/Aos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Copyright(c) 2023, 2024 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s): Engin Deniz Diktas <[email protected]>

#ifndef AOS_H
#define AOS_H

#include <map>
#include <memory>
#include <vector>
#include <qvector3d.h>

#include "Kml_reader.h"

class Aos {
public:
using Approx_arc = std::vector<QVector3D>;
using Approx_arcs = std::vector<Approx_arc>;
//using Arr_handle = void*;
using Arr_handle = std::shared_ptr<void>;

static Approx_arc get_approx_identification_curve(double error);

// this constructs some sample arcs manually (used to check the visual output)
static Approx_arcs get_approx_arcs(double error);

// this is used to construct approximate arcs from KML-Placemark data
static Approx_arcs get_approx_arcs(const Kml::Placemark& placemark,
double error);

static void get_curves();

static void check(const Kml::Placemarks& placemarks);

// Extended check: here we use the extended version of the DCEL to understand
// what is going on with the additional vertices and faces.
// INPUT: GIS data
// OUTPUT: vertices created during arrangement construction
static std::vector<QVector3D> ext_check(const Kml::Placemarks& placemarks);

// Same as above function but works by identifying the duplicate nodes
static std::vector<QVector3D> ext_check_id_based(Kml::Placemarks& placemarks);

// This function is used to find the newly-created faces during arrangement
// construction. It uses the extended DCEL structure (see: above 2 functions).
// NOTE: The need for this function arises due to the following observation:
// when constructing the arrangement from our data-set I observed a newly
// created face which is not defined explicitly in the data-set. My intiution
// tells me that this is the Caspian sea, because it is the only land-locked
// polygon whose boundaries are not defined in the data-set and its boundaries
// are defined indirecly by its surrounding countries.
static Approx_arcs find_new_faces(Kml::Placemarks& placemarks);

// save the arrangement created with EPEC
static void save_arr(Kml::Placemarks& placemarks,
const std::string& file_name);

// loads the arrangement created by the save_arr function
// NOTE: This one loads the arrangement as "Country_arr" type
static Arr_handle load_arr(const std::string& file_name);

static Arr_handle construct(Kml::Placemarks& placemarks);
//static std::vector<QVector3D> get_triangles(Arr_handle arrh);

//using Country_triangles_map = std::map<std::string, std::vector<QVector3D>>;
//static Country_triangles_map get_triangles_by_country(Arr_handle arrh);

using Country_color_map = std::map<std::string, int>;
static Country_color_map get_color_mapping(Arr_handle arrh);

static std::string locate_country(Arr_handle arrh, const QVector3D& point);

// this will get the approximate arcs of face-edges from the arrangement
// NOTE: this is similar to "get_approx_arcs(KML::Placemarks&, float)" above!
static Approx_arcs get_approx_arcs_from_faces_edges(Arr_handle arrh,
float error);
};

#endif
47 changes: 47 additions & 0 deletions Arrangement_on_surface_2/demo/earth/Aos_defs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright(c) 2023, 2024 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s): Engin Deniz Diktas <[email protected]>

#ifndef AOS_DEFS_H
#define AOS_DEFS_H

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Arrangement_on_surface_2.h>
#include <CGAL/Arr_extended_dcel.h>
#include <CGAL/Arr_geodesic_arc_on_sphere_traits_2.h>
#include <CGAL/Arr_spherical_topology_traits_2.h>
#include <CGAL/Vector_3.h>

//#define USE_EPIC

#ifdef USE_EPIC
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
#else
using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
#endif

using Geom_traits = CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel>;
using Point = Geom_traits::Point_2;
using Curve = Geom_traits::Curve_2;
using Topol_traits = CGAL::Arr_spherical_topology_traits_2<Geom_traits>;
using Arrangement = CGAL::Arrangement_on_surface_2<Geom_traits, Topol_traits>;

// the following is from "arr_inexact_construction_segments.h":
using Segment = Geom_traits::X_monotone_curve_2;
using Vertex_handle = Arrangement::Vertex_handle;

// COUNTRIES AOS for grouping the faces by the country name
using Countries_dcel = CGAL::Arr_face_extended_dcel<Geom_traits, std::string>;
using Countries_topol_traits =
CGAL::Arr_spherical_topology_traits_2<Geom_traits, Countries_dcel>;
using Countries_arr =
CGAL::Arrangement_on_surface_2<Geom_traits, Countries_topol_traits>;


#endif
Loading
Loading