Skip to content

Commit 991418e

Browse files
committed
fix compatibility and use generic macro in generic contexts
1 parent 05f4793 commit 991418e

File tree

9 files changed

+31
-27
lines changed

9 files changed

+31
-27
lines changed

Basic_viewer/include/CGAL/Basic_viewer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
// compatibility
2020
#if defined(CGAL_USE_BASIC_VIEWER) && !defined(CGAL_USE_BASIC_VIEWER_QT)
21+
#define CGAL_USE_BASIC_VIEWER_QT 1
22+
#endif
23+
24+
#if defined(CGAL_USE_BASIC_VIEWER_QT) && !defined(CGAL_USE_BASIC_VIEWER)
2125
#define CGAL_USE_BASIC_VIEWER 1
2226
#endif
2327

Polygon_repair/examples/Polygon_repair/repair_union_intersect_2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ main(int argc, char* argv[])
3939
{
4040
std::ofstream out("union.wkt");
4141
CGAL::IO::write_multi_polygon_WKT(out, mpwh);
42-
#ifdef CGAL_USE_BASIC_VIEWER_QT
42+
#ifdef CGAL_USE_BASIC_VIEWER
4343
CGAL::draw(mpwh);
4444
#endif
4545
}

Surface_mesh_topology/examples/Surface_mesh_topology/facewidth.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int main(int argc, char* argv[])
3333
{
3434
std::cout<<" Number of faces: "<<cycle.size()<<std::endl;
3535

36-
#ifdef CGAL_USE_BASIC_VIEWER_QT
36+
#ifdef CGAL_USE_BASIC_VIEWER
3737
if(argc>=3 && std::string(argv[2])=="-draw")
3838
{ draw_facewidth(lcc, cycle); }
3939
#endif

Surface_mesh_topology/examples/Surface_mesh_topology/path_homotopy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <CGAL/Path_on_surface.h>
55

66
/* If you want to use a viewer, you can use qglviewer. */
7-
#ifdef CGAL_USE_BASIC_VIEWER_QT
7+
#ifdef CGAL_USE_BASIC_VIEWER
88
#include <CGAL/draw_face_graph_with_paths.h>
99
#endif
1010

@@ -167,7 +167,7 @@ int main(int argc, char** argv)
167167
if (!res)
168168
{ errors_seeds.push_back(random.get_seed()); }
169169

170-
#ifdef CGAL_USE_BASIC_VIEWER_QT
170+
#ifdef CGAL_USE_BASIC_VIEWER
171171
if (draw)
172172
{ CGAL::draw(lcc, paths); }
173173
#endif

Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct Weight_functor
3232
const LCC_3& m_lcc;
3333
};
3434

35-
#ifdef CGAL_USE_BASIC_VIEWER_QT
35+
#ifdef CGAL_USE_BASIC_VIEWER
3636

3737
struct Draw_functor: public CGAL::Graphics_scene_options<LCC_3,
3838
typename LCC_3::Dart_const_handle,
@@ -63,16 +63,16 @@ struct Draw_functor: public CGAL::Graphics_scene_options<LCC_3,
6363
LCC_3::size_type belong_to_cycle;
6464
};
6565

66-
#endif // CGAL_USE_BASIC_VIEWER_QT
66+
#endif // CGAL_USE_BASIC_VIEWER
6767

6868
int main(int argc, char* argv[])
6969
{
7070
std::cout<<"Program unsew_edgewidth_repeatedly started."<<std::endl;
7171
std::string filename(argc==1?CGAL::data_file_path("meshes/double-torus-example.off"):argv[1]);
7272

73-
#ifdef CGAL_USE_BASIC_VIEWER_QT
73+
#ifdef CGAL_USE_BASIC_VIEWER
7474
bool draw=(argc<3?false:std::string(argv[2])=="-draw");
75-
#endif // CGAL_USE_BASIC_VIEWER_QT
75+
#endif // CGAL_USE_BASIC_VIEWER
7676

7777
std::ifstream inp(filename);
7878
if (inp.fail())
@@ -143,13 +143,13 @@ int main(int argc, char* argv[])
143143
}
144144
while(cycle_exist);
145145

146-
#ifdef CGAL_USE_BASIC_VIEWER_QT
146+
#ifdef CGAL_USE_BASIC_VIEWER
147147
if (draw)
148148
{
149149
Draw_functor df(is_root, belong_to_cycle);
150150
CGAL::draw(lccoriginal, df, "Unsew edge width repeatdly");
151151
}
152-
#endif // CGAL_USE_BASIC_VIEWER_QT
152+
#endif // CGAL_USE_BASIC_VIEWER
153153

154154
lccoriginal.free_mark(belong_to_cycle);
155155
lccoriginal.free_mark(is_root);

Surface_mesh_topology/test/Surface_mesh_topology/fundamental_group_of_the_circle.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Then it verify that
2020
#include <cassert>
2121

2222
// If you want to use a viewer, you can use qglviewer.
23-
#ifdef CGAL_USE_BASIC_VIEWER_QT
23+
#ifdef CGAL_USE_BASIC_VIEWER
2424
#include <CGAL/draw_face_graph_with_paths.h>
2525
#endif
2626

@@ -76,11 +76,11 @@ void create_positive_loop_24(Path_on_surface<SM>& p, unsigned int n)
7676
{
7777
p.extend_straight_positive((10*n)-1);
7878

79-
#ifdef CGAL_USE_BASIC_VIEWER_QT
79+
#ifdef CGAL_USE_BASIC_VIEWER
8080
/* std::vector<Path_on_surface<SM> > v;
8181
v.push_back(p);
8282
CGAL::draw(p.get_mesh(), v, "Title"); */
83-
#endif // CGAL_USE_BASIC_VIEWER_QT
83+
#endif // CGAL_USE_BASIC_VIEWER
8484

8585
assert(p.is_closed());
8686
}

Surface_mesh_topology/test/Surface_mesh_topology/fundamental_group_of_the_torus.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ int main()
119119
bool cij, ckl, hij_ij, hij_kl, hkl_ij, hkl_kl;
120120
bool test_valid=true;
121121
/*
122-
#ifdef CGAL_USE_BASIC_VIEWER_QT
122+
#ifdef CGAL_USE_BASIC_VIEWER
123123
std::vector<Path_on_surface<SM> > paths={pij, pkl};
124124
CGAL::draw(sm, paths); // Enable only if CGAL was compiled with Qt6
125-
#endif // CGAL_USE_BASIC_VIEWER_QT
125+
#endif // CGAL_USE_BASIC_VIEWER
126126
*/
127127
for (int i=-4; i<=4; ++i)
128128
{

Surface_mesh_topology/test/Surface_mesh_topology/path_with_rle_deformation_tests.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "Creation_of_test_cases_for_paths.h"
1212

1313
// If you want to use a viewer, you can use qglviewer.
14-
#ifdef CGAL_USE_BASIC_VIEWER_QT
14+
#ifdef CGAL_USE_BASIC_VIEWER
1515
#include <CGAL/draw_face_graph_with_paths.h>
1616
#endif
1717

@@ -53,21 +53,21 @@ void transform_path(Path_on_surface<LCC_3_cmap>& path, Transformation t,
5353
bool use_only_positive,
5454
bool use_only_negative,
5555
bool
56-
#ifdef CGAL_USE_BASIC_VIEWER_QT
56+
#ifdef CGAL_USE_BASIC_VIEWER
5757
draw
5858
#endif
5959
=false,
6060
std::size_t repeat=0) // If 0, repeat as long as there is one modification;
6161
// otherwise repeat the given number of times
6262
{
63-
#ifdef CGAL_USE_BASIC_VIEWER_QT
63+
#ifdef CGAL_USE_BASIC_VIEWER
6464
std::vector<Path_on_surface<LCC_3_cmap> > v;
6565
if (draw)
6666
{
6767
v.push_back(path);
6868
// CGAL::draw(path.get_map(), v);
6969
}
70-
#endif // CGAL_USE_BASIC_VIEWER_QT
70+
#endif // CGAL_USE_BASIC_VIEWER
7171

7272
internal::Light_MQ<LCC_3_cmap> lmq(path.get_map());
7373
Path_on_surface<LCC_3_cmap> prepp(path.get_map());
@@ -100,9 +100,9 @@ void transform_path(Path_on_surface<LCC_3_cmap>& path, Transformation t,
100100
if (modified)
101101
{
102102
prevp=Path_on_surface<LCC_3_cmap>(curp);
103-
#ifdef CGAL_USE_BASIC_VIEWER_QT
103+
#ifdef CGAL_USE_BASIC_VIEWER
104104
if (draw) { v.push_back(prevp); }
105-
#endif // CGAL_USE_BASIC_VIEWER_QT
105+
#endif // CGAL_USE_BASIC_VIEWER
106106
}
107107

108108
// if (draw /* && nbtest==1*/)
@@ -112,13 +112,13 @@ void transform_path(Path_on_surface<LCC_3_cmap>& path, Transformation t,
112112
}
113113
while((repeat==0 && modified) || (nb<repeat));
114114

115-
#ifdef CGAL_USE_BASIC_VIEWER_QT
115+
#ifdef CGAL_USE_BASIC_VIEWER
116116
if (draw)
117117
{
118118
std::string title="Test "+std::to_string(nbtests);
119119
CGAL::draw(path.get_map(), v, title.c_str());
120120
}
121-
#endif // CGAL_USE_BASIC_VIEWER_QT
121+
#endif // CGAL_USE_BASIC_VIEWER
122122

123123
path.swap(prevp);
124124
assert(path.is_valid(true));

Surface_mesh_topology/test/Surface_mesh_topology/test_homotopy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "Creation_of_test_cases_for_paths.h"
1111

1212
/* If you want to use a viewer, you can use qglviewer. */
13-
#ifdef CGAL_USE_BASIC_VIEWER_QT
13+
#ifdef CGAL_USE_BASIC_VIEWER
1414
#include <CGAL/draw_face_graph_with_paths.h>
1515
#endif
1616

@@ -44,7 +44,7 @@ bool unit_test_canonize(Curves_on_surface_topology<LCC_3_cmap>& cst,
4444
std::vector<Path_on_surface<LCC_3_cmap> >& paths,
4545
const char* msg,
4646
bool
47-
#ifdef CGAL_USE_BASIC_VIEWER_QT
47+
#ifdef CGAL_USE_BASIC_VIEWER
4848
draw
4949
#endif
5050
, int testtorun)
@@ -70,13 +70,13 @@ bool unit_test_canonize(Curves_on_surface_topology<LCC_3_cmap>& cst,
7070
}
7171
}
7272

73-
#ifdef CGAL_USE_BASIC_VIEWER_QT
73+
#ifdef CGAL_USE_BASIC_VIEWER
7474
if (draw)
7575
{
7676
std::string title="Test "+std::to_string(nbtests);
7777
CGAL::draw(paths[0].get_map(), paths, title.c_str());
7878
}
79-
#endif // CGAL_USE_BASIC_VIEWER_QT
79+
#endif // CGAL_USE_BASIC_VIEWER
8080

8181
#ifdef CGAL_TRACE_PATH_TESTS
8282
if (res) { std::cout<<std::endl; }

0 commit comments

Comments
 (0)