diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/arr_segs.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/arr_segs.tex index e6198387b5f0..e25fa3fd2be2 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/arr_segs.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/arr_segs.tex @@ -2,98 +2,95 @@ \input{header} \pagestyle{empty} \begin{document} -\psscalebox{1.8}{\arrset{0.8} - \pspicture[](-0.2,-0.2)(12.2,12.2) - %\psgrid(0,0)(12,12) - \arrMainVertex( 1, 3){a} - \arrMainVertex( 2, 4){b} - \arrMainVertex( 0, 6){c} - \arrv[90](5,11){1} - \arrMainVertex(9,11){f} - \arrMainVertex(12, 8){g} - \arrv[-60](8,8){2} - \arrMainVertex( 8, 4){i} - \arrMainVertex( 6, 4){j} - \arrMainVertex( 6, 2){k} - \arrMainVertex( 4, 0){m} - \arrMainVertex( 9, 0){n} - \arrMainVertex(11, 2){o} - \arrMainVertex(12, 4){p} - \arrMainVertex(12, 0){q} - \arrMainVertex( 4, 2){r} - \arrMainVertex( 3, 3){s} - \arrMainVertex( 5, 3){t} +\begin{tikzpicture}[scale=1.0,thick] + \node[point] at ( 1, 3) (a) {}; + \node[point] at ( 2, 4) (b) {}; + \node[point] at ( 0, 6) (c) {}; + \node [point,label={[label distance=0pt]90:{$v_1$}}] at ( 5,11) (1) {}; + \node[point] at ( 9,11) (f) {}; + \node[point] at (12, 8) (g) {}; + \node [point,label={[label distance=0pt]-45:{$v_2$}}] at ( 8, 8) (2) {}; + \node[point] at ( 8, 4) (i) {}; + \node[point] at ( 6, 4) (j) {}; + \node[point] at ( 6, 2) (k) {}; + \node[point] at ( 4, 0) (m) {}; + \node[point] at ( 9, 0) (n) {}; + \node[point] at (11, 2) (o) {}; + \node[point] at (12, 4) (p) {}; + \node[point] at (12, 0) (q) {}; + \node[point] at ( 4, 2) (r) {}; + \node[point] at ( 3, 3) (s) {}; + \node[point] at ( 5, 3) (t) {}; % - \ncline[linewidth=0.5pt,linecolor=blue]{a}{b} - \ncline[linewidth=0.5pt,linecolor=blue]{b}{c} - \ncline[linewidth=0.5pt,linecolor=blue]{c}{1} - \ncline[linewidth=0.5pt,linecolor=blue]{1}{f} - \ncline[linewidth=0.5pt,offset=3pt,nodesepB=6pt]{->}{f}{1}\Aput[1pt]{$e_{\mathrm{prev}}$} - \ncline[linewidth=0.5pt,linecolor=blue]{f}{g} - \ncline[linewidth=0.5pt,linecolor=blue]{g}{2} - \ncline[linewidth=0.5pt,linecolor=blue]{g}{2} - \ncline[linewidth=0.5pt,offset=3pt,nodesepB=4pt]{->}{2}{g}\Aput[1pt]{$e_{\mathrm{next}}$} - \ncline[linewidth=0.5pt,linecolor=blue]{2}{i} - \ncline[linewidth=0.5pt,linecolor=blue]{i}{j} - \ncline[linewidth=0.5pt,linecolor=blue]{j}{k} - \ncline[linewidth=0.5pt,linecolor=blue]{k}{m} - \ncline[linewidth=0.5pt,linecolor=blue]{m}{a} - \ncline[linewidth=0.5pt,linecolor=blue]{1}{2} - \ncline[linewidth=0.5pt,linecolor=blue]{g}{i} - \ncline[linewidth=0.5pt,linecolor=blue]{m}{n} - \ncline[linewidth=0.5pt,linecolor=blue]{n}{i} - \ncline[linewidth=0.5pt,linecolor=blue]{g}{n} - \ncline[linewidth=0.5pt,linecolor=blue]{n}{o} - \ncline[linewidth=0.5pt,linecolor=blue]{o}{p} - \ncline[linewidth=0.5pt,linecolor=blue]{p}{q} - \ncline[linewidth=0.5pt,linecolor=blue]{q}{o} - \ncline[linewidth=0.5pt,linecolor=blue]{r}{s} - \ncline[linewidth=0.5pt,offset=3pt]{->}{r}{s} - \ncline[linewidth=0.5pt,offset=3pt]{->}{s}{r} - \ncline[linewidth=0.5pt,linecolor=blue]{r}{t} - \ncline[linewidth=0.5pt,offset=3pt]{->}{r}{t} - \ncline[linewidth=0.5pt,offset=3pt]{->}{t}{r} + \draw[blue] (a)--(b); + \draw[blue] (b)--(c); + \draw[blue] (c)--(1); + \draw[blue] (1)--(f); + \draw [halfedge,shorten >=4pt] (f) to node[sloped,below]{$e_{\mathrm{prev}}$} (1); + \draw[blue] (f)--(g); + \draw[blue] (g)--(2); + \draw [halfedge,shorten >=4pt] (2) to node[sloped,above]{$e_{\mathrm{next}}$} (g); + \draw[blue] (2)--(i); + \draw[blue] (i)--(j); + \draw[blue] (j)--(k); + \draw[blue] (k)--(m); + \draw[blue] (m)--(a); + \draw[blue] (1)--(2); + \draw[blue] (g)--(i); + \draw[blue] (m)--(n); + \draw[blue] (n)--(i); + \draw[blue] (g)--(n); + \draw[blue] (n)--(o); + \draw[blue] (o)--(p); + \draw[blue] (p)--(q); + \draw[blue] (q)--(o); + \draw[blue] (r)--(s); % - \ncline[linewidth=0.5pt,offset=3pt]{->}{b}{a} - \ncline[linewidth=0.5pt,offset=3pt]{->}{c}{b} - \ncline[linewidth=0.5pt,offset=3pt]{->}{1}{c} - \ncline[linewidth=0.5pt,offset=3pt,nodesepA=4pt]{->}{g}{f} - \ncline[linewidth=0.5pt,offset=3pt]{->}{i}{2} - \ncline[linewidth=0.5pt,offset=3pt]{->}{j}{i} - \ncline[linewidth=0.5pt,offset=3pt]{->}{k}{j} - \ncline[linewidth=0.5pt,offset=3pt]{->}{m}{k} - \ncline[linewidth=0.5pt,offset=3pt]{->}{a}{m} - \ncline[linewidth=0.5pt,offset=3pt,nodesepA=6pt]{->}{1}{2}\Aput[1pt]{$e$} - \ncline[linewidth=0.5pt,offset=3pt]{->}{2}{1}\Aput[1pt]{$e'$} + \path [halfedge] (r) edge (s); + \path [halfedge] (s) edge (r); + \draw [blue] (r)--(t); + \path [halfedge] (r) edge (t); + \path [halfedge] (t) edge (r); % - \rput(2,10){$f_0$} - \rput(3,4){$f_1$} - \rput(8.5,9.5){$f_2$} - \rput(5,7){$f_3$} - \rput(4.5,5.6){$f_4$} + \path [halfedge] (b) edge (a); + \path [halfedge] (c) edge (b); + \path [halfedge] (1) edge (c); + \path [halfedge,shorten <=4pt] (g) edge (f); + \path [halfedge] (i) edge (2); + \path [halfedge] (j) edge (i); + \path [halfedge] (k) edge (j); + \path [halfedge] (m) edge (k); + \path [halfedge] (a) edge (m); + \draw [halfedge,shorten <=4pt] (1) to node[sloped,above=-1pt]{$e$} (2); + \draw [halfedge] (2) to node[sloped,below=-1pt]{$e'$} (1); % - \arru[90](2,6){1} - \arru[90](5,9){2} + \node at (2,10){$f_0$}; + \node at (3,4){$f_1$}; + \node at (8.5,9.5){$f_2$}; + \node at (5,7){$f_3$}; + \node at (4.5,5.6){$f_4$}; % - \arrMainVertex(4,5){a} - \arrMainVertex(4,7){b} - \arrMainVertex(5,8){c} - \arrMainVertex(5,4){f} - \arrMainVertex(5,6){e} - \arrMainVertex(6,7){d} - \ncline[linewidth=0.5pt,linecolor=blue]{a}{b} - \ncline[linewidth=0.5pt,linecolor=blue]{b}{c} - \ncline[linewidth=0.5pt,linecolor=blue]{c}{d} - \ncline[linewidth=0.5pt,linecolor=blue]{d}{e} - \ncline[linewidth=0.5pt,linecolor=blue]{e}{f} - \ncline[linewidth=0.5pt,linecolor=blue]{f}{a} - \ncline[linewidth=0.5pt,linecolor=blue]{b}{e} - \ncline[linewidth=0.5pt,offset=3pt]{->}{a}{b} - \ncline[linewidth=0.5pt,offset=3pt]{->}{b}{c} - \ncline[linewidth=0.5pt,offset=3pt]{->}{c}{d} - \ncline[linewidth=0.5pt,offset=3pt]{->}{d}{e} - \ncline[linewidth=0.5pt,offset=3pt]{->}{e}{f} - \ncline[linewidth=0.5pt,offset=3pt]{->}{f}{a} - \endpspicture -} + \node [point,label={[label distance=0pt]90:{$u_1$}}] at (2,6) (1) {}; + \node [point,label={[label distance=0pt]90:{$u_2$}}] at (5,9) (1) {}; + % + \node[point] at (4,5) (a) {}; + \node[point] at (4,7) (b) {}; + \node[point] at (5,8) (c) {}; + \node[point] at (5,4) (f) {}; + \node[point] at (5,6) (e) {}; + \node[point] at (6,7) (d) {}; + \draw[blue] (a)--(b); + \draw[blue] (b)--(c); + \draw[blue] (c)--(d); + \draw[blue] (d)--(e); + \draw[blue] (e)--(f); + \draw[blue] (f)--(a); + \draw[blue] (b)--(e); + \path [halfedge] (a) edge (b); + \path [halfedge] (b) edge (c); + \path [halfedge] (c) edge (d); + \path [halfedge] (d) edge (e); + \path [halfedge] (e) edge (f); + \path [halfedge] (f) edge (a); +\end{tikzpicture}% \end{document} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/bezier_curves.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/bezier_curves.tex index e0013b99d728..6266e6524d04 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/bezier_curves.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/bezier_curves.tex @@ -2,7 +2,7 @@ \input{header} \pagestyle{empty} \begin{document} -\psscalebox{1.8}{\arrset{1}% +\psscalebox{1}{\arrset{1}% \def\bodyBezier{ \psline[linecolor=blue](2295,5175)(2492.01,5062.83)(2677.89,4983.16)(2854.44,4929.86)(3023.31,4897.62)(3185.98,4881.79)(3343.77,4878.41)(3497.83,4884.1)(3649.2,4896.04)(3798.76,4911.9)(3947.28,4929.78)(4095.39,4948.19)(4243.63,4965.94)(4392.4,4982.15)(4542.04,4996.13)(4692.77,5007.39)(4844.74,5015.54)(4998.01,5020.26)(5152.6,5021.23)(5308.42,5018.09)(5465.37,5010.38)(5623.29,4997.49)(5781.96,4978.58)(5941.15,4952.58)(6100.6,4918.08)(6260.03,4873.33)(6419.14,4816.11)(6577.65,4743.77)(6735.25,4653.1)(6891.68,4540.32)(7046.68,4400.99)(7200,4230) \psline[linecolor=blue](8460,6165)(8622.25,6003.86)(8725.83,5853.19)(8782.58,5711.47)(8802.7,5577.35)(8794.88,5449.63)(8766.41,5327.29)(8723.29,5209.44)(8670.37,5095.32)(8611.44,4984.3)(8549.35,4875.84)(8486.17,4769.53)(8423.24,4665.02)(8361.36,4562.04)(8300.84,4460.4)(8241.66,4359.96)(8183.58,4260.61)(8126.25,4162.29)(8069.34,4064.94)(8012.64,3968.53)(7956.2,3873.02)(7900.41,3778.35)(7846.17,3684.44)(7794.97,3591.19)(7749.02,3498.44)(7711.36,3405.97)(7685.99,3313.49)(7677.98,3220.65)(7693.59,3127)(7740.38,3031.97)(7827.34,2934.9)(7965,2835) diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/header.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/header.tex index b75164d2a5cb..26980faab6f0 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/header.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/header.tex @@ -43,10 +43,25 @@ \usepackage{tikz} \usepackage{pgfplots} \usepackage{mathptmx} -\usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings,matrix,fit,decorations.pathreplacing,arrows,automata,positioning,shapes,chains,spy} -%\usetikzlibrary{quotes,angles,graph} -\usetikzlibrary{intersections,through,backgrounds} +\usetikzlibrary{calc} +\usetikzlibrary{backgrounds} +\usetikzlibrary{decorations.pathmorphing} +\usetikzlibrary{decorations.markings} +\usetikzlibrary{decorations.pathreplacing} +\usetikzlibrary{patterns} +\usetikzlibrary{matrix} +\usetikzlibrary{fit} +\usetikzlibrary{arrows,arrows.meta} +\usetikzlibrary{automata} +\usetikzlibrary{positioning} +\usetikzlibrary{shapes} +\usetikzlibrary{chains} +\usetikzlibrary{spy} +\usetikzlibrary{intersections} +\usetikzlibrary{through} +\usetikzlibrary{cd} \usepackage{tikz-3dplot} +%\usetikzlibrary{quotes,angles,graph} \tikzset{% invisible/.style={opacity=0}, only/.code args={<#1>#2}{\only<#1>{\pgfkeysalso{#2}}}, @@ -54,8 +69,49 @@ temporal/.code args={<#1>#2#3#4}{% \temporal<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}{\pgfkeysalso{#4}}}, point/.style={circle,inner sep=1.5pt,minimum size=1.5pt,draw,fill=#1}, - point/.default=red + point/.default=red, + halfedge/.style={-{Stealth[left,scale=1.5]},commutative diagrams/shift left=#1}, + halfedge/.default=3pt } +% ------------------------------------------------------------------------------ +% #1 half length of tick +% #2 min x +% #3 min y +% #4 max x +% #5 max y +\NewDocumentCommand{\myAxes}{O{4pt}mmmmO{0.001}}{% + %axis + \draw[-{Stealth[scale=1.5]}] (#2,0)--(#4,0); + \draw[-{Stealth[scale=1.5]}] (0,#3)--(0,#5); + %ticks + \pgfmathtruncatemacro{\xs}{int(#2)}; + \pgfmathtruncatemacro{\xe}{int(#4-#6)}; + \pgfmathtruncatemacro{\ys}{int(#3)}; + \pgfmathtruncatemacro{\ye}{int(#5-#6)}; + \foreach \x in {\xs,...,\xe} \draw (\x,#1)--(\x,-#1); + \foreach \y in {\ys,...,\ye} \draw (#1,\y)--(-#1,\y);% +} +% ------------------------------------------------------------------------------ +%Syntax: [draw options] (center) (initial angle:final angle:radius) +\def\centerarc[#1](#2)(#3:#4:#5){\draw[#1]([shift=(#3:#5)]#2) arc (#3:#4:#5)} +% ------------------------------------------------------------------------------ +\def\arrCrossVertexZ(#1)#2#3{\node[cross=#3] at (#1) (#2) {};} +\def\arrQueryVertexZ(#1)#2{\arrCrossVertexZ(#1){#2}{red}} +\def\arrCrossLabeledVertexZ[#1](#2)#3#4#5{\node [cross=#5,label={[label distance=-3pt]#1:{#4}}] at (#2) (#3) {};} +\def\arrQueryLabeledVertexZ[#1](#2)#3#4{\arrCrossLabeledVertexZ[#1](#2){#3}{#4}{red}} +% +\def\arrColorVertexZ(#1)#2#3{\node[point=#3] at (#1) (#2) {};} +\def\arrMinorVertexZ(#1)#2{\arrColorVertexZ(#1){#2}{cyan}} +\def\arrMainVertexZ(#1)#2{\arrColorVertexZ(#1){#2}{red}} +\def\arrIntersectionVertexZ(#1)#2{\arrColorVertexZ(#1){#2}{white}} +\def\arrColoredLabeledVertexZ[#1](#2)#3#4#5{\node [point=#5,label={[label distance=-3pt]#1:{#4}}] at (#2) (#3) {};} +\def\arrMainLabeledVertexZ[#1](#2)#3#4{\arrColoredLabeledVertexZ[#1](#2){#3}{#4}{red}} +\def\arrMinorLabeledVertexZ[#1](#2)#3#4{\arrColoredLabeledVertexZ[#1](#2){#3}{#4}{cyan}} +% ------------------------------------------------------------------------------ +\def\arrvZ[#1](#2)#3{\arrColoredLabeledVertexZ[#1](#2){#3}{$v_{#3}$}{red}} +\def\arruZ[#1](#2)#3{\arrColoredLabeledVertexZ[#1](#2){#3}{$u_{#3}$}{red}} +\def\arrpZ[#1](#2)#3{\arrColoredLabeledVertexZ[#1](#2){#3}{$p_{#3}$}{red}} +% ============================================================================== \makeatletter \def\nodesDef{\@ifnextchar[{\@nodesDefWith}{\@nodesDefWithout}} \def\@nodesDefWith[#1]#2{\foreach \c in #2 { \node[point=#1] (n\c) at (\c) {}; }} @@ -81,6 +137,7 @@ % \usepackage{picins} \usepackage[absolute,overlay]{textpos} \usepackage{ifthen} +\usepackage{xparse} \usepackage{etoolbox} % diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/insert.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/insert.tex index 44f58b9c38a4..060f751f1335 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/insert.tex +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/insert.tex @@ -2,96 +2,92 @@ \input{header} \pagestyle{empty} \begin{document} -\psscalebox{1.8}{\arrset{0.5}% - \begin{tabular}{ccc} - \pspicture[](0.5,0)(10,7) - \arrMainVertex(1,4){a} - \arrMainVertex(5,6){b} - \arrMainVertex(9,4){c} - \arrMainVertex(7,2){d} - \arrMainVertex(3,1){e} - \arrMainVertex(3,2){f} - \ncline[linewidth=0.5pt,linecolor=blue]{a}{b} - \ncline[linewidth=0.5pt,linecolor=blue]{b}{c} - \ncline[linewidth=0.5pt,linecolor=blue]{c}{d} - \ncline[linewidth=0.5pt,linecolor=blue]{d}{e} - \ncline[linewidth=0.5pt,linecolor=blue]{e}{f} - \ncline[linewidth=0.5pt,linecolor=blue]{f}{a} - \arrMinorVertex(3,3){1}\uput[135]{0}(3,3){$v_1$} - \arrMinorVertex(6,4){2}\uput[-45]{0}(6,4){$v_2$} - \ncline[linestyle=dashed,linewidth=0.5pt,linecolor=blue]{1}{2} - \ncline[linewidth=0.5pt,offset=3pt]{->}{1}{2} - \ncline[linewidth=0.5pt,offset=3pt]{->}{2}{1} - \rput(5,5){$f$} - \psframe[linewidth=0.5pt](0.5,0)(10,7) - \endpspicture & - % - \pspicture[](0.5,0)(10,7) - \arrMainVertex(1,3){a} - \arrMainVertex(2,5){b} - \arrMainVertex(5,6){c} - \arrMainVertex(7,3){u} - \uput[180]{0}(7,3){$u$} - \arrMainVertex(5,1){e} - \arrMainVertex(3,2){f} - \arrMainVertex(2,1){g} - \ncline[linewidth=0.5pt,linecolor=blue]{a}{b} - \ncline[linewidth=0.5pt,linecolor=blue]{b}{c} - \ncline[linewidth=0.5pt,linecolor=blue]{c}{u} - \ncline[linewidth=0.5pt,linecolor=blue]{u}{e} - \ncline[linewidth=0.5pt,linecolor=blue]{e}{f} - \ncline[linewidth=0.5pt,linecolor=blue]{f}{g} - \ncline[linewidth=0.5pt,linecolor=blue]{g}{a} - \arrMinorVertex(9,4){v} - \uput[90]{0}(9,4){$v$} - \ncline[linestyle=dashed,linewidth=0.5pt,linecolor=blue]{u}{v} - \ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt]{->}{c}{u} - \ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt]{->}{u}{e} - \ncline[linewidth=0.5pt,offset=3pt]{->}{u}{v} - \ncline[linewidth=0.5pt,offset=3pt]{->}{v}{u} - \psframe[linewidth=0.5pt](0.5,0)(10,7) - \endpspicture & - % - \pspicture[](0.5,0)(10,7) - \arrMainVertex(1,3){a} - \arrMainVertex(2,6){b} - \arru[45](5,6){1} - \arru[-45](7,1){2} - \arrMainVertex(4,2){e} - \arrMainVertex(2,1){f} - \ncline[linewidth=0.5pt,linecolor=blue]{a}{b} - \ncline[linewidth=0.5pt,linecolor=blue]{b}{1} - \ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt]{->}{b}{1} - \ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt]{->}{1}{b} - \ncline[linestyle=dashed,linewidth=0.5pt,linecolor=blue]{1}{2} - \ncline[linewidth=0.5pt,offset=3pt]{->}{1}{2} - \ncline[linewidth=0.5pt,offset=3pt,nodesepA=6pt]{->}{2}{1} - \ncline[linewidth=0.5pt,linecolor=blue]{2}{e} - \ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt]{->}{2}{e} - \ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt,nodesepB=4pt]{->}{e}{2} - \ncline[linewidth=0.5pt,linecolor=blue]{e}{f} - \ncline[linewidth=0.5pt,linecolor=blue]{f}{a} - \arrMainVertex(2.5,4){a} - \arrMainVertex(3.5,5){b} - \arrMainVertex(4.5,4){c} - \arrMainVertex(3.5,3){d} - \ncline[linewidth=0.5pt,linecolor=blue]{a}{b} - \ncline[linewidth=0.5pt,linecolor=blue]{b}{c} - \ncline[linewidth=0.5pt,linecolor=blue]{c}{d}\Aput[1pt]{$h_1$} - \ncline[linewidth=0.5pt,linecolor=blue]{d}{a} - \ncline[linewidth=0.5pt,linecolor=blue]{a}{c} - \rput(1,5){$f$} - \rput(2.5,5){$f'$} - \arrMainVertex(7,4){a} - \arrMainVertex(8,4){b} - \arrMainVertex(8,5){c} - \arrMainVertex(9,3){d} - \ncline[linewidth=0.5pt,linecolor=blue]{a}{b} - \ncline[linewidth=0.5pt,linecolor=blue]{b}{c} - \ncline[linewidth=0.5pt,linecolor=blue]{c}{a} - \ncline[linewidth=0.5pt,linecolor=blue]{b}{d}\Aput[1pt]{$h_2$} - \psframe[linewidth=0.5pt](0.5,0)(10,7) - \endpspicture - \end{tabular} -} +\begin{tabular}{ccc} + \begin{tikzpicture} + \node[point] at (1,4) (a) {}; + \node[point] at (5,6) (b) {}; + \node[point] at (9,4) (c) {}; + \node[point] at (7,2) (d) {}; + \node[point] at (3,1) (e) {}; + \node[point] at (3,2) (f) {}; + \draw[blue,very thick](a)--(b); + \draw[blue,very thick](b)--(c); + \draw[blue,very thick](c)--(d); + \draw[blue,very thick](d)--(e); + \draw[blue,very thick](e)--(f); + \draw[blue,very thick](f)--(a); + \node[point=cyan,label={[label distance=0pt]135:{$v_1$}}] at (3,3) (1) {}; + \node[point=cyan,label={[label distance=0pt]135:{$v_2$}}] at (6,4) (2) {}; + \draw[dashed,blue,very thick] (1)--(2); + \draw[halfedge] (1) to (2); + \draw[halfedge] (2) to (1); + \node at (5,5) {$f$}; + \draw[thin](0.5,0) rectangle (10,7); + \end{tikzpicture} & + % + \begin{tikzpicture} + \node[point] at (1,3) (a) {}; + \node[point] at (2,5) (b) {}; + \node[point] at (5,6) (c) {}; + \node[point,label={[label distance=0pt]180:{$u$}}] at (7,3) (u) {}; + \node[point] at (5,1) (e) {}; + \node[point] at (3,2) (f) {}; + \node[point] at (2,1) (g) {}; + \draw[blue,very thick](a)--(b); + \draw[blue,very thick](b)--(c); + \draw[blue,very thick](c)--(u); + \draw[blue,very thick](u)--(e); + \draw[blue,very thick](e)--(f); + \draw[blue,very thick](f)--(g); + \draw[blue,very thick](g)--(a); + \node[point=cyan,label={[label distance=0pt]90:{$v$}}] at (9,4) (v) {}; + \draw[dashed,blue,very thick] (u)--(v); + \draw[dashed,halfedge] (c) to (u); + \draw[dashed,halfedge] (u) to (e); + \draw[halfedge] (u) to (v); + \draw[halfedge] (v) to (u); + \draw[thin] (0.5,0) rectangle (10,7); + \end{tikzpicture} & + % + \begin{tikzpicture} + \node[point] at (1,3) (a) {}; + \node[point] at (2,6) (b) {}; + \node[point,label={[label distance=0pt]45:{$u_1$}}] at (5,6) (1) {}; + \node[point,label={[label distance=0pt]45:{$u_2$}}] at (7,1) (2) {}; + \node[point] at (4,2) (e) {}; + \node[point] at (2,1) (f) {}; + \draw[blue,very thick](a)--(b); + \draw[blue,very thick](b)--(1); + \draw[dashed,thick,halfedge] (b) to (1); + \draw[dashed,thick,halfedge] (1) to (b); + \draw[dashed,blue,very thick](1)--(2); + \draw[thick,halfedge] (1) to (2); + \draw[thick,halfedge,shorten <=4pt] (2) to (1); + \draw[blue,very thick] (2)--(e); + \draw[dashed,halfedge] (2) to (e); + \draw[dashed,halfedge,shorten >=4pt] (e) to (2); + \draw[blue,very thick] (e)--(f); + \draw[blue,very thick] (f)--(a); + \node[point] at (2.5,4) (a) {}; + \node[point] at (3.5,5) (b) {}; + \node[point] at (4.5,4) (c) {}; + \node[point] at (3.5,3) (d) {}; + \draw[blue,very thick](a)--(b); + \draw[blue,very thick](b)--(c); + \draw[blue,very thick](c)-- node[midway,below,sloped] {$h_1$} (d); + \draw[blue,very thick](d)--(a); + \draw[blue,very thick](a)--(c); + \node at (1,5) {$f$}; + \node at (2.5,5) {$f'$}; + \node[point] at (7,4) (a) {}; + \node[point] at (8,4) (b) {}; + \node[point] at (8,5) (c) {}; + \node[point] at (9,3) (d) {}; + \draw[blue,very thick] (a)--(b); + \draw[blue,very thick] (b)--(c); + \draw[blue,very thick] (c)--(a); + \draw[blue,very thick] (b)-- node[midway,below,sloped] {$h_2$} (d); + \draw[thin] (0.5,0) rectangle (10,7); + \end{tikzpicture} +\end{tabular} \end{document} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/jeep.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/jeep.tex new file mode 100644 index 000000000000..abd944d4d68d --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/jeep.tex @@ -0,0 +1,11 @@ +\documentclass[tikz, border=5mm]{standalone} +\usepackage{tikz} +\usetikzlibrary{patterns.meta} +\usetikzlibrary{shapes.geometric} +\begin{document} +\begin{tikzpicture} + \draw[line width=0.2pt,draw=black, + pattern={Hatch[angle=45,distance={6pt},line width=0.4pt]}, + pattern color=black](0,0) rectangle (10,6); +\end{tikzpicture} +\end{document} diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/makefile b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/makefile index c0fa903663d8..5d139e1af614 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/makefile +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/makefile @@ -49,7 +49,9 @@ TARGETS = \ overlay_color.pdf \ bgl_primal_adapter.pdf \ bgl_dual_adapter.pdf \ - unb_asymptote.pdf + unb_asymptote.pdf \ + min_area_tri.pdf \ + jeep.pdf .DEFAULT_GOAL = all .PHONY: all clean diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/min_area_tri.tex b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/min_area_tri.tex new file mode 100644 index 000000000000..aff139201b0a --- /dev/null +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/fig_src/min_area_tri.tex @@ -0,0 +1,17 @@ +\documentclass[11pt]{report} +\input{header} +\pagestyle{empty} +\begin{document} +\begin{tikzpicture}[scale=1.0,thick] + \myAxes[4pt]{-2.5}{-1.5}{2.5}{2.5} + \foreach \x in {-2,...,2} \node[label={[label distance=-6pt]-45:{\scriptsize $\x$}}] at (\x,0) {}; + \foreach \y in {-1,...,2} \node[label={[label distance=-6pt]135:{\scriptsize $\y$}}] at (0,\y) {}; + \draw[step=1.0,dotted](-2,-1)grid(2,2); + \filldraw[fill=lightred,draw=darkred](-1,0)--(-0.5,1)--( 1,1)--cycle; + \arrpZ[45](-2,2.25){1} + \arrpZ[135](-1,0){2} + \arrpZ[135](-0.5,1){3} + \arrpZ[45]( 0.5,-1){4} + \arrpZ[45]( 1,1){5} +\end{tikzpicture}% +\end{document} diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Edge_length.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Edge_length.h index 7ac8eb85dbc0..fe533d91c193 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Edge_length.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Edge_length.h @@ -4,15 +4,15 @@ #include #include -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef Kernel::FT Number_type; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Number_type = Kernel::FT; template struct Edge_length { // Boost property-type definitions. - typedef boost::readable_property_map_tag category; - typedef Number_type value_type; - typedef value_type reference; - typedef typename Arrangement::Halfedge_handle key_type; + using category = boost::readable_property_map_tag; + using value_type = Number_type; + using reference = value_type; + using key_type = typename Arrangement::Halfedge_handle; value_type operator()(typename Arrangement::Halfedge_handle e) const { const auto diff_x = e->target()->point().x() - e->source()->point().x(); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Extended_face_property_map.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Extended_face_property_map.h index d85ce59f669d..e98b15799cf2 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Extended_face_property_map.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Extended_face_property_map.h @@ -4,13 +4,13 @@ // A property map that reads/writes the information to/from the extended face. template class Extended_face_property_map { public: - typedef typename Arrangement::Face_handle Face_handle; + using Face_handle = typename Arrangement::Face_handle; // Boost property type definitions. - typedef boost::read_write_property_map_tag category; - typedef Type value_type; - typedef value_type& reference; - typedef Face_handle key_type; + using category = boost::read_write_property_map_tag; + using value_type = Type; + using reference = value_type&; + using key_type = Face_handle; // The get function is required by the property map concept. friend reference get(const Extended_face_property_map& /* map */, key_type key) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Overlay_color_traits.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Overlay_color_traits.h index 66d31c7c6506..6c04c312cb4f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Overlay_color_traits.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/Overlay_color_traits.h @@ -2,13 +2,13 @@ #define OVERLAY_COLOR_TRAITS_H template struct Overlay_color_traits { - typedef unsigned int Color; - typedef typename Arrangement::Vertex_const_handle V_const_handle; - typedef typename Arrangement::Halfedge_const_handle H_const_handle; - typedef typename Arrangement::Face_const_handle F_const_handle; - typedef typename Arrangement::Vertex_handle V_handle; - typedef typename Arrangement::Halfedge_handle H_handle; - typedef typename Arrangement::Face_handle F_handle; + using Color = unsigned int; + using V_const_handle = typename Arrangement::Vertex_const_handle; + using H_const_handle = typename Arrangement::Halfedge_const_handle; + using F_const_handle = typename Arrangement::Face_const_handle; + using V_handle = typename Arrangement::Vertex_handle; + using H_handle = typename Arrangement::Halfedge_handle; + using F_handle = typename Arrangement::Face_handle; // Compute the average of the red, green, and blue components separately. Color blend(Color color1, Color color2) const diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp index 8d0a27ae5705..f8bc222897b7 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_curves.cpp @@ -21,10 +21,10 @@ int main () #include "integer_type.h" #include "arr_print.h" -typedef CGAL::Arr_algebraic_segment_traits_2 Traits; -typedef CGAL::Arrangement_2 Arrangement; -typedef Traits::Curve_2 Curve; -typedef Traits::Polynomial_2 Polynomial; +using Traits = CGAL::Arr_algebraic_segment_traits_2; +using Arrangement = CGAL::Arrangement_2; +using Curve = Traits::Curve_2; +using Polynomial = Traits::Polynomial_2; int main() { CGAL::IO::set_pretty_mode(std::cout); // for nice printouts. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp index 69c4a66ea689..aba48b9f2224 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp @@ -21,15 +21,15 @@ int main () #include "integer_type.h" #include "arr_print.h" -typedef CGAL::Arr_algebraic_segment_traits_2 Traits; -typedef CGAL::Arrangement_2 Arrangement; -typedef Traits::Curve_2 Curve; -typedef Traits::Polynomial_2 Polynomial; -typedef Traits::Algebraic_real_1 Algebraic_real; -typedef Traits::X_monotone_curve_2 X_monotone_curve; -typedef Traits::Point_2 Point; - -typedef std::variant Make_x_monotone_result; +using Traits = CGAL::Arr_algebraic_segment_traits_2; +using Arrangement = CGAL::Arrangement_2; +using Curve = Traits::Curve_2; +using Polynomial = Traits::Polynomial_2; +using Algebraic_real = Traits::Algebraic_real_1; +using X_monotone_curve = Traits::X_monotone_curve_2; +using Point = Traits::Point_2; + +using Make_x_monotone_result = std::variant; int main() { Traits traits; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_Bezier.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_Bezier.h index 30d978942c8d..b78d0192ca44 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_Bezier.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_Bezier.h @@ -6,17 +6,17 @@ #include #include -typedef CGAL::CORE_algebraic_number_traits Nt_traits; -typedef Nt_traits::Rational NT; -typedef Nt_traits::Rational Rational; -typedef Nt_traits::Algebraic Algebraic; -typedef CGAL::Cartesian Rat_kernel; -typedef CGAL::Cartesian Alg_kernel; -typedef Rat_kernel::Point_2 Rat_point; -typedef CGAL::Arr_Bezier_curve_traits_2 - Traits; -typedef Traits::X_monotone_curve_2 Bezier_x_monotone_curve; -typedef Traits::Curve_2 Bezier_curve; -typedef CGAL::Arrangement_2 Arrangement; +using Nt_traits = CGAL::CORE_algebraic_number_traits; +using NT = Nt_traits::Rational; +using Rational = Nt_traits::Rational; +using Algebraic = Nt_traits::Algebraic; +using Rat_kernel = CGAL::Cartesian; +using Alg_kernel = CGAL::Cartesian; +using Rat_point = Rat_kernel::Point_2; +using Traits = + CGAL::Arr_Bezier_curve_traits_2; +using Bezier_x_monotone_curve = Traits::X_monotone_curve_2; +using Bezier_curve = Traits::Curve_2; +using Arrangement = CGAL::Arrangement_2; #endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_circular.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_circular.h index 752a1e84a2df..da88c3dfeb15 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_circular.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_circular.h @@ -5,16 +5,16 @@ #include #include -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef Kernel::FT Number_type; -typedef CGAL::Arr_circle_segment_traits_2 Traits; -typedef Traits::CoordNT CoordNT; -typedef Traits::Point_2 Point; -typedef Traits::Curve_2 Curve; -typedef Traits::X_monotone_curve_2 X_monotone_curve; -typedef Traits::Rational_point_2 Rational_point; -typedef Traits::Rational_segment_2 Segment; -typedef Traits::Rational_circle_2 Circle; -typedef CGAL::Arrangement_2 Arrangement; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Number_type = Kernel::FT; +using Traits = CGAL::Arr_circle_segment_traits_2; +using CoordNT = Traits::CoordNT; +using Point = Traits::Point_2; +using Curve = Traits::Curve_2; +using X_monotone_curve = Traits::X_monotone_curve_2; +using Rational_point = Traits::Rational_point_2; +using Segment = Traits::Rational_segment_2; +using Circle = Traits::Rational_circle_2; +using Arrangement = CGAL::Arrangement_2; #endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_exact_construction_segments.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_exact_construction_segments.h index 9a80ccddf386..8673bf88d2a8 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_exact_construction_segments.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_exact_construction_segments.h @@ -5,19 +5,19 @@ #include #include -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef Kernel::FT Number_type; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Number_type = Kernel::FT; -typedef CGAL::Arr_segment_traits_2 Traits; -typedef Traits::Point_2 Point; -typedef Traits::X_monotone_curve_2 Segment; +using Traits = CGAL::Arr_segment_traits_2; +using Point = Traits::Point_2; +using Segment = Traits::X_monotone_curve_2; -typedef CGAL::Arrangement_2 Arrangement; -typedef Arrangement::Vertex_handle Vertex_handle; -typedef Arrangement::Halfedge_handle Halfedge_handle; -typedef Arrangement::Face_handle Face_handle; -typedef Arrangement::Vertex_const_handle Vertex_const_handle; -typedef Arrangement::Halfedge_const_handle Halfedge_const_handle; -typedef Arrangement::Face_const_handle Face_const_handle; +using Arrangement = CGAL::Arrangement_2; +using Vertex_handle = Arrangement::Vertex_handle; +using Halfedge_handle = Arrangement::Halfedge_handle; +using Face_handle = Arrangement::Face_handle; +using Vertex_const_handle = Arrangement::Vertex_const_handle; +using Halfedge_const_handle = Arrangement::Halfedge_const_handle; +using Face_const_handle = Arrangement::Face_const_handle; #endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_geodesic_on_sphere.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_geodesic_on_sphere.h index 5223a580111e..295c43cde6cf 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_geodesic_on_sphere.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_geodesic_on_sphere.h @@ -6,21 +6,20 @@ #include #include -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef Kernel::FT Number_type; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Number_type = Kernel::FT; -typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2 Geom_traits; -typedef Geom_traits::Point_2 Point; -typedef Geom_traits::X_monotone_curve_2 X_monotone_curve; -typedef CGAL::Arr_spherical_topology_traits_2 Topol_traits; -typedef CGAL::Arrangement_on_surface_2 - Arrangement; +using Geom_traits = CGAL::Arr_geodesic_arc_on_sphere_traits_2; +using Point = Geom_traits::Point_2; +using X_monotone_curve = Geom_traits::X_monotone_curve_2; +using Topol_traits = CGAL::Arr_spherical_topology_traits_2; +using Arrangement = CGAL::Arrangement_on_surface_2; -typedef Arrangement::Vertex_handle Vertex_handle; -typedef Arrangement::Halfedge_handle Halfedge_handle; -typedef Arrangement::Face_handle Face_handle; -typedef Arrangement::Vertex_const_handle Vertex_const_handle; -typedef Arrangement::Halfedge_const_handle Halfedge_const_handle; -typedef Arrangement::Face_const_handle Face_const_handle; +using Vertex_handle = Arrangement::Vertex_handle; +using Halfedge_handle = Arrangement::Halfedge_handle; +using Face_handle = Arrangement::Face_handle; +using Vertex_const_handle = Arrangement::Vertex_const_handle; +using Halfedge_const_handle = Arrangement::Halfedge_const_handle; +using Face_const_handle = Arrangement::Face_const_handle; #endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_inexact_construction_segments.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_inexact_construction_segments.h index d38181e0f330..a6c2f4d9d8c0 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_inexact_construction_segments.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_inexact_construction_segments.h @@ -5,16 +5,16 @@ #include #include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::FT Number_type; +using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; +using Number_type = Kernel::FT; -typedef CGAL::Arr_non_caching_segment_traits_2 Traits; -typedef Traits::Point_2 Point; -typedef Traits::X_monotone_curve_2 Segment; +using Traits = CGAL::Arr_non_caching_segment_traits_2; +using Point = Traits::Point_2; +using Segment = Traits::X_monotone_curve_2; -typedef CGAL::Arrangement_2 Arrangement; -typedef Arrangement::Vertex_handle Vertex_handle; -typedef Arrangement::Halfedge_handle Halfedge_handle; -typedef Arrangement::Face_handle Face_handle; +using Arrangement = CGAL::Arrangement_2; +using Vertex_handle = Arrangement::Vertex_handle; +using Halfedge_handle = Arrangement::Halfedge_handle; +using Face_handle = Arrangement::Face_handle; #endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_linear.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_linear.h index 8dad9c70f593..d30ad3ae4dbd 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_linear.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_linear.h @@ -5,22 +5,22 @@ #include #include -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef Kernel::FT Number_type; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Number_type = Kernel::FT; -typedef CGAL::Arr_linear_traits_2 Traits; -typedef Traits::Point_2 Point; -typedef Traits::Segment_2 Segment; -typedef Traits::Ray_2 Ray; -typedef Traits::Line_2 Line; -typedef Traits::X_monotone_curve_2 X_monotone_curve; +using Traits = CGAL::Arr_linear_traits_2; +using Point = Traits::Point_2; +using Segment = Traits::Segment_2; +using Ray = Traits::Ray_2; +using Line = Traits::Line_2; +using X_monotone_curve = Traits::X_monotone_curve_2; -typedef CGAL::Arrangement_2 Arrangement; -typedef Arrangement::Vertex_handle Vertex_handle; -typedef Arrangement::Halfedge_handle Halfedge_handle; -typedef Arrangement::Face_handle Face_handle; -typedef Arrangement::Vertex_const_handle Vertex_const_handle; -typedef Arrangement::Halfedge_const_handle Halfedge_const_handle; -typedef Arrangement::Face_const_handle Face_const_handle; +using Arrangement = CGAL::Arrangement_2; +using Vertex_handle = Arrangement::Vertex_handle; +using Halfedge_handle = Arrangement::Halfedge_handle; +using Face_handle = Arrangement::Face_handle; +using Vertex_const_handle = Arrangement::Vertex_const_handle; +using Halfedge_const_handle = Arrangement::Halfedge_const_handle; +using Face_const_handle = Arrangement::Face_const_handle; #endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_polylines.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_polylines.h index 710f3f05f8b2..97f0413c5216 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_polylines.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_polylines.h @@ -6,14 +6,14 @@ #include #include -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef Kernel::FT Number_type; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Number_type = Kernel::FT; -typedef CGAL::Arr_segment_traits_2 Segment_traits; -typedef CGAL::Arr_polyline_traits_2 Traits; -typedef Traits::Point_2 Point; -typedef Traits::Segment_2 Segment; -typedef Traits::Curve_2 My_polyline; -typedef CGAL::Arrangement_2 Arrangement; +using Segment_traits = CGAL::Arr_segment_traits_2; +using Traits = CGAL::Arr_polyline_traits_2; +using Point = Traits::Point_2; +using Segment = Traits::Segment_2; +using My_polyline = Traits::Curve_2; +using Arrangement = CGAL::Arrangement_2; #endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_rat_functions.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_rat_functions.h index 79abccb062ca..f3d42944e805 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_rat_functions.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/arr_rat_functions.h @@ -7,14 +7,14 @@ #include #include -typedef CORE::BigInt Number_type; -typedef CGAL::Algebraic_kernel_d_1 AK1; -typedef CGAL::Arr_rational_function_traits_2 Traits; +using Number_type = CORE::BigInt; +using AK1 = CGAL::Algebraic_kernel_d_1; +using Traits = CGAL::Arr_rational_function_traits_2; -typedef Traits::Polynomial_1 Polynomial; -typedef Traits::Algebraic_real_1 Alg_real; -typedef Traits::Bound Bound; +using Polynomial = Traits::Polynomial_1; +using Alg_real = Traits::Algebraic_real_1; +using Bound = Traits::Bound; -typedef CGAL::Arrangement_2 Arrangement; +using Arrangement = CGAL::Arrangement_2; #endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp index f2cbc29815d4..a88e118f38c0 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/batched_point_location.cpp @@ -10,8 +10,8 @@ #include "arr_inexact_construction_segments.h" #include "point_location_utils.h" -typedef CGAL::Arr_point_location_result Point_location_result; -typedef std::pair Query_result; +using Point_location_result = CGAL::Arr_point_location_result; +using Query_result = std::pair; int main() { // Construct the arrangement. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp index d059facf8f95..3d0f0b65c314 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_dual_adapter.cpp @@ -15,12 +15,12 @@ #include "arr_exact_construction_segments.h" #include "arr_print.h" -typedef CGAL::Arr_face_extended_dcel Dcel; -typedef CGAL::Arrangement_2 Ex_arrangement; -typedef CGAL::Dual Dual_arrangement; -typedef CGAL::Arr_face_index_map Face_index_map; -typedef Extended_face_property_map - Face_property_map; +using Dcel = CGAL::Arr_face_extended_dcel; +using Ex_arrangement = CGAL::Arrangement_2; +using Dual_arrangement = CGAL::Dual; +using Face_index_map = CGAL::Arr_face_index_map; +using Face_property_map = + Extended_face_property_map; int main() { // Construct an arrangement of seven intersecting line segments. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_primal_adapter.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_primal_adapter.cpp index 163125c0e3df..e7d6720af5db 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_primal_adapter.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bgl_primal_adapter.cpp @@ -15,8 +15,8 @@ #include "arr_exact_construction_segments.h" #include "Edge_length.h" -typedef CGAL::Arr_vertex_index_map Vertex_index_map; -typedef Edge_length My_edge_length; +using Vertex_index_map = CGAL::Arr_vertex_index_map; +using My_edge_length = Edge_length; int main() { // Construct an arrangement of seven intersecting line segments. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp index 3f1403ecebdb..77137ced4873 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/bounded_vertical_decomposition.cpp @@ -8,9 +8,9 @@ #include "arr_exact_construction_segments.h" -typedef std::pair Object_pair; -typedef std::pair Vert_decomp_entry; -typedef std::list Vert_decomp_list; +using Object_pair = std::pair; +using Vert_decomp_entry = std::pair; +using Vert_decomp_list = std::list; int main() { // Construct the arrangement. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp index 750986dda1eb..0d3e8cc3d169 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/circular_line_arcs.cpp @@ -15,23 +15,23 @@ #include -typedef CGAL::Quotient NT; -typedef CGAL::Cartesian Linear_k; -typedef CGAL::Algebraic_kernel_for_circles_2_2 Algebraic_k; -typedef CGAL::Circular_kernel_2 Circular_k; +using NT = CGAL::Quotient; +using Linear_k = CGAL::Cartesian; +using Algebraic_k = CGAL::Algebraic_kernel_for_circles_2_2; +using Circular_k = CGAL::Circular_kernel_2; -typedef Circular_k::Point_2 Point_2; -typedef Circular_k::Circle_2 Circle_2; -typedef Circular_k::Circular_arc_2 Circular_arc_2; -typedef Circular_k::Line_arc_2 Line_arc_2; +using Point_2 = Circular_k::Point_2; +using Circle_2 = Circular_k::Circle_2; +using Circular_arc_2 = Circular_k::Circular_arc_2; +using Line_arc_2 = Circular_k::Line_arc_2; -typedef std::variant< Circular_arc_2, Line_arc_2> Arc_2; -typedef std::vector< Arc_2> ArcContainer; +using Arc_2 = std::variant< Circular_arc_2, Line_arc_2>; +using ArcContainer = std::vector< Arc_2>; -typedef CGAL::Arr_circular_line_arc_traits_2 Traits; +using Traits = CGAL::Arr_circular_line_arc_traits_2; -typedef CGAL::Arrangement_2 Arrangement; -typedef CGAL::Arr_naive_point_location Point_location; +using Arrangement = CGAL::Arrangement_2; +using Point_location = CGAL::Arr_naive_point_location; int main() { CGAL::Random generatorOfgenerator; @@ -46,7 +46,7 @@ int main() { for (int i = 0; i < 10; i++) { x1 = theRandom.get_int(random_min,random_max); y1 = theRandom.get_int(random_min,random_max); - do{ + do { x2 = theRandom.get_int(random_min,random_max); y2 = theRandom.get_int(random_min,random_max); } while((x1 == x2) && (y1 == y2)); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp index 752f6e21f9dd..5eaccf5db9ef 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/conic_multiplicities.cpp @@ -11,7 +11,7 @@ #include "arr_conics.h" #include "arr_print.h" -typedef CGAL::Arr_naive_point_location Naive_pl; +using Naive_pl = CGAL::Arr_naive_point_location; int main() { Traits traits; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp index 2bb6b9084758..55ea5aada147 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/consolidated_curve_data.cpp @@ -9,10 +9,10 @@ enum Segment_color {RED, BLUE}; -typedef CGAL::Arr_consolidated_curve_data_traits_2 - Data_traits; -typedef Data_traits::Curve_2 Colored_segment; -typedef CGAL::Arrangement_2 Colored_arr; +using Data_traits = + CGAL::Arr_consolidated_curve_data_traits_2; +using Colored_segment = Data_traits::Curve_2; +using Colored_arr = CGAL::Arrangement_2; int main() { Colored_arr arr; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp index 49fa78bff2bf..4a7b7a57bdb4 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/curve_history.cpp @@ -8,9 +8,9 @@ #include "arr_exact_construction_segments.h" #include "point_location_utils.h" -typedef CGAL::Arrangement_with_history_2 Arr_with_hist; -typedef Arr_with_hist::Curve_handle Curve_handle; -typedef CGAL::Arr_trapezoid_ric_point_location Point_location; +using Arr_with_hist = CGAL::Arrangement_with_history_2; +using Curve_handle = Arr_with_hist::Curve_handle; +using Point_location = CGAL::Arr_trapezoid_ric_point_location; int main() { // Insert 3 curves incrementally. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp index 3801d3126ae8..88140318fd22 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension.cpp @@ -8,8 +8,8 @@ enum Color {BLUE, RED, WHITE}; -typedef CGAL::Arr_extended_dcel Dcel; -typedef CGAL::Arrangement_2 Ex_arrangement; +using Dcel = CGAL::Arr_extended_dcel; +using Ex_arrangement = CGAL::Arrangement_2; int main() { // Construct the arrangement containing two intersecting triangles. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp index 2be07e6bf1bb..441e4f7b6cac 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dcel_extension_io.cpp @@ -31,9 +31,9 @@ std::istream& operator>>(std::istream& is, Color& color) { return is; } -typedef CGAL::Arr_extended_dcel Ext_dcel; -typedef CGAL::Arrangement_2 Ext_arrangement; -typedef CGAL::Arr_extended_dcel_text_formatter Formatter; +using Ext_dcel = CGAL::Arr_extended_dcel; +using Ext_arrangement = CGAL::Arrangement_2; +using Formatter = CGAL::Arr_extended_dcel_text_formatter; int main() { // Construct the arrangement containing two intersecting triangles. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp index ea99cca39a85..df84f9727337 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp @@ -1,9 +1,9 @@ -#include +#include #include #include #include -using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; using Traits = CGAL::Arr_segment_traits_2; using Point = Traits::Point_2; using Arrangement_2 = CGAL::Arrangement_2; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp index e81a00c5d58d..8ffb6688971e 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp @@ -10,9 +10,9 @@ #include "arr_linear.h" #include "read_objects.h" -typedef CGAL::Arr_curve_data_traits_2 Data_traits; -typedef Data_traits::X_monotone_curve_2 Data_x_monotone_curve_2; -typedef CGAL::Arrangement_2 Data_arrangement; +using Data_traits = CGAL::Arr_curve_data_traits_2; +using Data_x_monotone_curve_2 = Data_traits::X_monotone_curve_2; +using Data_arrangement = CGAL::Arrangement_2; int main(int argc, char* argv[]) { // Get the name of the input file from the command line, or use the default diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp index bd636bc94fe5..bf1d504d4f6b 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/edge_manipulation_curve_history.cpp @@ -8,9 +8,9 @@ #include "arr_circular.h" #include "arr_print.h" -typedef CGAL::Arrangement_with_history_2 Arr_with_hist; -typedef Arr_with_hist::Curve_handle Curve_handle; -typedef CGAL::Arr_walk_along_line_point_location Point_location; +using Arr_with_hist = CGAL::Arrangement_with_history_2; +using Curve_handle = Arr_with_hist::Curve_handle; +using Point_location = CGAL::Arr_walk_along_line_point_location; int main() { // Construct an arrangement containing nine circles: C[0] of radius 2 and diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp index 5778412a8dc0..8befee7dafcf 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension.cpp @@ -7,8 +7,8 @@ #include "arr_exact_construction_segments.h" -typedef CGAL::Arr_face_extended_dcel Dcel; -typedef CGAL::Arrangement_2 Ex_arrangement; +using Dcel = CGAL::Arr_face_extended_dcel; +using Ex_arrangement = CGAL::Arrangement_2; // An arrangement observer, used to receive notifications of face splits and // to update the indices of the newly created faces. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp index 7eda7deea852..27459e6ff9e2 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/face_extension_overlay.cpp @@ -9,12 +9,11 @@ #include "arr_exact_construction_segments.h" -typedef CGAL::Arr_face_extended_dcel Dcel; -typedef CGAL::Arrangement_2 Ex_arrangement; -typedef CGAL::Arr_face_overlay_traits > - Overlay_traits; +using Dcel = CGAL::Arr_face_extended_dcel; +using Ex_arrangement = CGAL::Arrangement_2; +using Overlay_traits = + CGAL::Arr_face_overlay_traits>; int main() { // Construct the first arrangement, containing a square-shaped face. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp index 5756885a48ee..72710580dee3 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/generic_curve_data.cpp @@ -7,18 +7,18 @@ #include "arr_polylines.h" -typedef std::string Name; // The name-field type. +using Name = std::string; // The name-field type. struct Merge_names { Name operator() (const Name& s1, const Name& s2) const { return (s1 + " " + s2); } }; -typedef CGAL::Arr_curve_data_traits_2 - Ex_traits; -typedef Ex_traits::Curve_2 Ex_polyline; -typedef Ex_traits::X_monotone_curve_2 Ex_x_monotone_polyline; -typedef CGAL::Arrangement_2 Ex_arrangement; +using Ex_traits = CGAL::Arr_curve_data_traits_2; + +using Ex_polyline = Ex_traits::Curve_2; +using Ex_x_monotone_polyline = Ex_traits::X_monotone_curve_2; +using Ex_arrangement = CGAL::Arrangement_2; int main() { // Construct an arrangement of four polylines named A--D. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp index 59a0203a4b45..857a5ecdf01d 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/incremental_insertion.cpp @@ -7,8 +7,8 @@ #include "arr_exact_construction_segments.h" #include "arr_print.h" -typedef CGAL::Arr_naive_point_location Naive_pl; -typedef CGAL::Arr_point_location_result::Type Pl_result_type; +using Naive_pl = CGAL::Arr_naive_point_location; +using Pl_result_type = CGAL::Arr_point_location_result::Type; int main() { // Construct the arrangement of five intersecting segments. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/integer_type.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/integer_type.h index 994567478152..b03f83fd832d 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/integer_type.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/integer_type.h @@ -5,13 +5,13 @@ #if CGAL_USE_GMP && CGAL_USE_MPFI #include -typedef CGAL::Gmpz Integer; +using Integer = CGAL::Gmpz; #elif CGAL_USE_CORE #include -typedef CORE::BigInt Integer; +using Integer = CORE::BigInt; #else #include -typedef LEDA::integer Integer; +using Integer = LEDA::integer; #endif #endif diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp index de866be3ada2..b62c6a93ff99 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/io_curve_history.cpp @@ -10,7 +10,7 @@ #include "arr_exact_construction_segments.h" #include "arr_print.h" -typedef CGAL::Arrangement_with_history_2 Arr_with_hist; +using Arr_with_hist = CGAL::Arrangement_with_history_2; int main() { // Insert six additional segments aggregately: diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp index 6cb7f17f477b..42c7f69aaffc 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_color.cpp @@ -11,9 +11,9 @@ #include "arr_exact_construction_segments.h" #include "Overlay_color_traits.h" -typedef unsigned int Color; -typedef CGAL::Arr_extended_dcel Dcel; -typedef CGAL::Arrangement_2 Ex_arrangement; +using Color = unsigned int; +using Dcel = CGAL::Arr_extended_dcel; +using Ex_arrangement = CGAL::Arrangement_2; int main() { const Color vcol1(0x00000080), hcol1(0x000000ff), fcol1(0x00ccccff); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp index 866c66016d1d..40d06f4f712c 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/overlay_unbounded.cpp @@ -16,15 +16,15 @@ struct Overlay_label { { return c + std::to_string(i); } }; -typedef CGAL::Arr_face_extended_dcel Dcel_dlue; -typedef CGAL::Arrangement_2 Arrangement_blue; -typedef CGAL::Arr_face_extended_dcel Dcel_red; -typedef CGAL::Arrangement_2 Arrangement_red; -typedef CGAL::Arr_face_extended_dcel Dcel_res; -typedef CGAL::Arrangement_2 Arrangement_res; -typedef CGAL::Arr_face_overlay_traits - Overlay_traits; +using Dcel_dlue = CGAL::Arr_face_extended_dcel; +using Arrangement_blue = CGAL::Arrangement_2; +using Dcel_red = CGAL::Arr_face_extended_dcel; +using Arrangement_red = CGAL::Arrangement_2; +using Dcel_res = CGAL::Arr_face_extended_dcel; +using Arrangement_res = CGAL::Arrangement_2; +using Overlay_traits = + CGAL::Arr_face_overlay_traits; int main() { // Construct the first arrangement, induced by two lines y = x and y = -x. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp index 31224d3363c8..8f9c0458d55e 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location.cpp @@ -8,8 +8,8 @@ #include "arr_inexact_construction_segments.h" #include "point_location_utils.h" -typedef CGAL::Arr_naive_point_location Naive_pl; -typedef CGAL::Arr_landmarks_point_location Landmarks_pl; +using Naive_pl = CGAL::Arr_naive_point_location; +using Landmarks_pl = CGAL::Arr_landmarks_point_location; int main() { // Construct the arrangement. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h index d5a729edc6d9..8dd199fde072 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/point_location_utils.h @@ -9,10 +9,10 @@ void print_point_location (const typename Arrangement_::Point_2& q, typename CGAL::Arr_point_location_result::Type obj) { - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; - typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; - typedef typename Arrangement_2::Face_const_handle Face_const_handle; + using Arrangement_2 = Arrangement_; + using Vertex_const_handle = typename Arrangement_2::Vertex_const_handle; + using Halfedge_const_handle = typename Arrangement_2::Halfedge_const_handle; + using Face_const_handle = typename Arrangement_2::Face_const_handle; const Vertex_const_handle* v; const Halfedge_const_handle* e; @@ -39,8 +39,8 @@ void locate_point(const PointLocation& pl, const typename PointLocation::Arrangement_2::Point_2& q) { // Perform the point-location query. - typedef PointLocation Point_location; - typedef typename Point_location::Arrangement_2 Arrangement_2; + using Point_location = PointLocation; + using Arrangement_2 = typename Point_location::Arrangement_2; typename CGAL::Arr_point_location_result::Type obj = pl.locate(q); @@ -56,16 +56,16 @@ void shoot_vertical_ray(const VerticalRayShooting& vrs, const typename VerticalRayShooting::Arrangement_2::Point_2& q) { - typedef VerticalRayShooting Vertical_ray_shooting; + using Vertical_ray_shooting = VerticalRayShooting; // Perform the point-location query. typename Vertical_ray_shooting::result_type obj = vrs.ray_shoot_up(q); // Print the result. - typedef typename Vertical_ray_shooting::Arrangement_2 Arrangement_2; - typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; - typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; - typedef typename Arrangement_2::Face_const_handle Face_const_handle; + using Arrangement_2 = typename Vertical_ray_shooting::Arrangement_2; + using Vertex_const_handle = typename Arrangement_2::Vertex_const_handle; + using Halfedge_const_handle = typename Arrangement_2::Halfedge_const_handle; + using Face_const_handle = typename Arrangement_2::Face_const_handle; const Vertex_const_handle* v; const Halfedge_const_handle* e; @@ -94,10 +94,10 @@ void shoot_vertical_ray(const VerticalRayShooting& vrs, template void construct_segments_arr(Arrangement_& arr) { - typedef Arrangement_ Arrangement_2; - typedef typename Arrangement_2::Point_2 Point_2; - typedef typename Arrangement_2::X_monotone_curve_2 Segment_2; - typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; + using Arrangement_2 = Arrangement_; + using Point_2 = typename Arrangement_2::Point_2; + using Segment_2 = typename Arrangement_2::X_monotone_curve_2; + using Halfedge_handle = typename Arrangement_2::Halfedge_handle; Point_2 p0(3,2), p1(0,3), p2(2,5), p3(4,5), p4(6,3), p5(3,0); Segment_2 s1(p1, p2), s2(p2, p3), s3(p3, p4), s4(p4, p5), s5(p5, p1); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp index 70184f7f4bb5..309a849e64bd 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_bezier.cpp @@ -19,12 +19,12 @@ int main() { #include "arr_Bezier.h" #include "arr_print.h" -typedef CGAL::Arr_polycurve_traits_2 Polycurve_bezier_traits; -typedef Polycurve_bezier_traits::Point_2 Point; -typedef Polycurve_bezier_traits::X_monotone_curve_2 X_mono_polycurve; -typedef CGAL::Arrangement_2 Arrangement_2; +using Polycurve_bezier_traits = CGAL::Arr_polycurve_traits_2; +using Point = Polycurve_bezier_traits::Point_2; +using X_mono_polycurve = Polycurve_bezier_traits::X_monotone_curve_2; +using Arrangement_2 = CGAL::Arrangement_2; -typedef std::variant Make_x_monotone_result; +using Make_x_monotone_result = std::variant; int main() { Polycurve_bezier_traits pc_traits; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp index 00827b0da577..742473a79bfa 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_circular_arc.cpp @@ -22,11 +22,11 @@ int main() { #include "arr_circular.h" #include "arr_print.h" -typedef CGAL::Arr_polycurve_traits_2 Polycurve_traits; -typedef Polycurve_traits::X_monotone_curve_2 X_monotone_polycurve; -typedef Polycurve_traits::Curve_2 Polycurve; -typedef Kernel::Circle_2 Circle_2; -typedef CGAL::Arrangement_2 Polycurve_circ_arc_arrangment; +using Polycurve_traits = CGAL::Arr_polycurve_traits_2; +using X_monotone_polycurve = Polycurve_traits::X_monotone_curve_2; +using Polycurve = Polycurve_traits::Curve_2; +using Circle_2 = Kernel::Circle_2; +using Polycurve_circ_arc_arrangment = CGAL::Arrangement_2; int main() { Polycurve_traits traits; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp index 803a0696bd28..bdaafb9ebb0c 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_conic.cpp @@ -21,10 +21,10 @@ int main() { #include "arr_conics.h" #include "arr_print.h" -typedef CGAL::Arr_polycurve_traits_2 Polycurve_conic_traits_2; -typedef Polycurve_conic_traits_2::X_monotone_curve_2 X_monotone_polycurve; -typedef Polycurve_conic_traits_2::Curve_2 Polycurve; -typedef CGAL::Arrangement_2 Polycurve_conic_arrangment; +using Polycurve_conic_traits_2 = CGAL::Arr_polycurve_traits_2; +using X_monotone_polycurve = Polycurve_conic_traits_2::X_monotone_curve_2; +using Polycurve = Polycurve_conic_traits_2::Curve_2; +using Polycurve_conic_arrangment = CGAL::Arrangement_2; int main() { Traits sub_traits; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_geodesic.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_geodesic.cpp index fdf6a5d0a5a7..008730bba159 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_geodesic.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurve_geodesic.cpp @@ -10,31 +10,29 @@ #include #include -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2 Segment_traits_2; -typedef CGAL::Arr_polyline_traits_2 Poly_traits_2; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Segment_traits_2 = CGAL::Arr_geodesic_arc_on_sphere_traits_2; +using Poly_traits_2 = CGAL::Arr_polyline_traits_2; -typedef Poly_traits_2::Point_2 Point_2; -typedef Poly_traits_2::Curve_2 Poly_curve_2; -typedef Poly_traits_2::X_monotone_curve_2 X_poly_curve_2; -typedef CGAL::Arr_spherical_topology_traits_2 - Topol_poly_traits_2; -typedef CGAL::Arrangement_on_surface_2 - Poly_arr; +using Point_2 = Poly_traits_2::Point_2; +using Poly_curve_2 = Poly_traits_2::Curve_2; +using X_poly_curve_2 = Poly_traits_2::X_monotone_curve_2; +using Topol_poly_traits_2 = + CGAL::Arr_spherical_topology_traits_2; +using Poly_arr = + CGAL::Arrangement_on_surface_2; -typedef Segment_traits_2::Curve_2 Seg_curve_2; -typedef Segment_traits_2::X_monotone_curve_2 X_seg_curve_2; -typedef CGAL::Arr_spherical_topology_traits_2 - Topol_segment_traits_2; -typedef CGAL::Arrangement_on_surface_2 - Segment_arr; +using Seg_curve_2 = Segment_traits_2::Curve_2; +using X_seg_curve_2 = Segment_traits_2::X_monotone_curve_2; +using Topol_segment_traits_2 = + CGAL::Arr_spherical_topology_traits_2; +using Segment_arr = + CGAL::Arrangement_on_surface_2; int main() { Segment_traits_2 seg_traits; - Segment_traits_2::Construct_point_2 ctr_p = - seg_traits.construct_point_2_object(); - Segment_traits_2::Construct_x_monotone_curve_2 ctr_seg = - seg_traits.construct_x_monotone_curve_2_object(); + auto ctr_p = seg_traits.construct_point_2_object(); + auto ctr_seg = seg_traits.construct_x_monotone_curve_2_object(); Point_2 p1 = ctr_p(0, 1, -1); Point_2 p2 = ctr_p(-11, 7, -7); @@ -62,8 +60,7 @@ int main() { points.push_back(p5); Poly_traits_2 poly_traits; - Poly_traits_2::Construct_x_monotone_curve_2 ctr = - poly_traits.construct_x_monotone_curve_2_object(); + auto ctr = poly_traits.construct_x_monotone_curve_2_object(); Poly_arr poly_arr(&poly_traits); insert(poly_arr, ctr(seg_cv1)); insert(poly_arr, ctr(seg_cv2)); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurves_basic.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurves_basic.cpp index 016c0ef74de5..90bfde3c0a00 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurves_basic.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/polycurves_basic.cpp @@ -10,14 +10,14 @@ #include "arr_print.h" -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef CGAL::Arr_directional_non_caching_segment_basic_traits_2 - Subcurve_traits; -typedef CGAL::Arr_polycurve_basic_traits_2 Geom_traits; -typedef Geom_traits::Point_2 Point; -typedef Subcurve_traits::X_monotone_curve_2 X_monotone_subcurve; -typedef Geom_traits::X_monotone_curve_2 X_monotone_curve; -typedef CGAL::Arrangement_2 Arrangement; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Subcurve_traits = + CGAL::Arr_directional_non_caching_segment_basic_traits_2; +using Geom_traits = CGAL::Arr_polycurve_basic_traits_2; +using Point = Geom_traits::Point_2; +using X_monotone_subcurve = Subcurve_traits::X_monotone_curve_2; +using X_monotone_curve = Geom_traits::X_monotone_curve_2; +using Arrangement = CGAL::Arrangement_2; int main() { Geom_traits traits; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp index cca02d632103..f0ed969d845a 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp @@ -3,9 +3,9 @@ // predefined kernel with exact constructions and exact predicates. #include +#include #include -#include #include "arr_exact_construction_segments.h" #include "arr_print.h" @@ -28,18 +28,17 @@ int main (int argc, char* argv[]) { // Construct the arrangement by aggregately inserting all segments. Arrangement arr; - CGAL::Timer timer; std::cout << "Performing aggregated insertion of " << segments.size() << " segments.\n"; - timer.start(); + auto start = std::chrono::system_clock::now(); insert(arr, segments.begin(), segments.end()); - timer.stop(); + std::chrono::duration secs = std::chrono::system_clock::now() - start; print_arrangement_size(arr); - std::cout << "Construction took " << timer.time() << " seconds.\n"; + std::cout << "Construction took " << secs.count() << " seconds.\n"; return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp index 87b05dcbb15a..2300d13c7814 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp @@ -2,19 +2,20 @@ // Constructing an arrangement of non-intersecting line segments using the // predefined kernel with exact predicates. +#include +#include +#include + #include #include #include -#include -#include -#include -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::FT Number_type; -typedef CGAL::Arr_non_caching_segment_basic_traits_2 Traits_2; -typedef Traits_2::Point_2 Point_2; -typedef Traits_2::X_monotone_curve_2 Segment_2; -typedef CGAL::Arrangement_2 Arrangement_2; +using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; +using Number_type = Kernel::FT; +using Traits_2 = CGAL::Arr_non_caching_segment_basic_traits_2; +using Point_2 = Traits_2::Point_2; +using Segment_2 = Traits_2::X_monotone_curve_2; +using Arrangement_2 = CGAL::Arrangement_2; int main(int argc, char* argv[]) { // Get the name of the input file from the command line, or use the default @@ -39,33 +40,31 @@ int main(int argc, char* argv[]) { // // source and target of segment #n. std::list segments; - unsigned int n; + std::size_t n; in_file >> n; - unsigned int i; - for (i = 0; i < n; ++i) { + for (std::size_t i = 0; i < n; ++i) { double sx, sy, tx, ty; in_file >> sx >> sy >> tx >> ty; - segments.push_back (Segment_2 (Point_2 (Number_type(sx), Number_type(sy)), - Point_2 (Number_type(tx), Number_type(ty)))); + segments.push_back(Segment_2(Point_2 (Number_type(sx), Number_type(sy)), + Point_2 (Number_type(tx), Number_type(ty)))); } in_file.close(); // Construct the arrangement by aggregately inserting all segments. Arrangement_2 arr; - CGAL::Timer timer; std::cout << "Performing aggregated insertion of " << n << " segments.\n"; - timer.start(); + auto start = std::chrono::system_clock::now(); insert_non_intersecting_curves (arr, segments.begin(), segments.end()); - timer.stop(); + std::chrono::duration secs = std::chrono::system_clock::now() - start; // Print the arrangement dimensions. std::cout << "V = " << arr.number_of_vertices() - << ", E = " << arr.number_of_edges() - << ", F = " << arr.number_of_faces() << std::endl; + << ", E = " << arr.number_of_edges() + << ", F = " << arr.number_of_faces() << std::endl; - std::cout << "Construction took " << timer.time() << " seconds.\n"; + std::cout << "Construction took " << secs.count() << " seconds.\n"; return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp index 2419a5868bbb..4267a229f7c0 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions_rational_coefficients.cpp @@ -18,23 +18,22 @@ int main() { #include // Traits #include // Arrangement -typedef CORE::BigInt Integer; -typedef CORE::BigRat Rational; -typedef CGAL::Algebraic_kernel_d_1 AK1; -typedef CGAL::Arr_rational_function_traits_2 Traits_2; +using Integer = CORE::BigInt; +using Rational = CORE::BigRat; +using AK1 = CGAL::Algebraic_kernel_d_1; +using Traits_2 = CGAL::Arr_rational_function_traits_2; -typedef std::vector Rat_vec; -typedef Traits_2::Algebraic_real_1 Alg_real_1; +using Rat_vec = std::vector; +using Alg_real_1 = Traits_2::Algebraic_real_1; -typedef CGAL::Arrangement_2 Arrangement_2; +using Arrangement_2 = CGAL::Arrangement_2; int main () { CGAL::IO::set_pretty_mode(std::cout); // for nice printouts. // Traits class object Traits_2 traits; - Traits_2::Construct_x_monotone_curve_2 construct_arc - = traits.construct_x_monotone_curve_2_object(); + auto construct_arc = traits.construct_x_monotone_curve_2_object(); // container storing all arcs std::vector arcs; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp index 98515d5d0c9d..1b27e3bdda0e 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/sgm_point_location.cpp @@ -14,36 +14,36 @@ #include "point_location_utils.h" -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef Kernel::Point_3 Point_3; -typedef Kernel::Direction_3 Direction_3; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Point_3 = Kernel::Point_3; +using Direction_3 = Kernel::Direction_3; #if 0 -typedef CGAL::Arr_polyhedral_sgm_traits Gm_traits; +using Gm_traits = CGAL::Arr_polyhedral_sgm_traits; #elif 0 -typedef CGAL::Arr_polyhedral_sgm_traits Gm_traits; +using Gm_traits = CGAL::Arr_polyhedral_sgm_traits; #else -typedef CGAL::Arr_polyhedral_sgm_traits Gm_traits; +using Gm_traits = CGAL::Arr_polyhedral_sgm_traits; #endif -typedef CGAL::Arr_polyhedral_sgm Gm; -typedef CGAL::Arr_polyhedral_sgm_polyhedron_3 Gm_polyhedron; -typedef CGAL::Arr_polyhedral_sgm_initializer Gm_initializer; +using Gm = CGAL::Arr_polyhedral_sgm; +using Gm_polyhedron = CGAL::Arr_polyhedral_sgm_polyhedron_3; +using Gm_initializer = CGAL::Arr_polyhedral_sgm_initializer; -typedef CGAL::Arr_naive_point_location Naive_pl; -typedef CGAL::Arr_walk_along_line_point_location Walk_pl; -typedef CGAL::Arr_landmarks_point_location Landmarks_pl; -typedef CGAL::Arr_trapezoid_ric_point_location Trap_pl; +using Naive_pl = CGAL::Arr_naive_point_location; +using Walk_pl = CGAL::Arr_walk_along_line_point_location; +using Landmarks_pl = CGAL::Arr_landmarks_point_location; +using Trap_pl = CGAL::Arr_trapezoid_ric_point_location; -typedef Gm::Geometry_traits_2 Geom_traits; -typedef Geom_traits::Point_2 Point_2; +using Geom_traits = Gm::Geometry_traits_2; +using Point_2 = Geom_traits::Point_2; -typedef CGAL::Arr_point_location_result Point_location_result; -typedef std::pair Query_result; +using Point_location_result = CGAL::Arr_point_location_result; +using Query_result = std::pair; -typedef Gm::Vertex_const_handle Vertex_const_handle; -typedef Gm::Halfedge_const_handle Halfedge_const_handle; -typedef Gm::Face_const_handle Face_const_handle; +using Vertex_const_handle = Gm::Vertex_const_handle; +using Halfedge_const_handle = Gm::Halfedge_const_handle; +using Face_const_handle = Gm::Face_const_handle; int main() { Gm_polyhedron p; @@ -77,7 +77,7 @@ int main() { gm_initializer(p); if (! gm.is_valid()) return -1; - Geom_traits::Construct_point_2 ctr_point = traits.construct_point_2_object(); + auto ctr_point = traits.construct_point_2_object(); Point_2 points[] = { ctr_point(-1, 0, 0), ctr_point(0, -1, 0), diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_sweep.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_sweep.cpp index 8c6f46dfeb61..62d7b46654c6 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_sweep.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_degenerate_sweep.cpp @@ -15,31 +15,30 @@ #include "arr_print.h" -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; #if 0 -typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2 Geom_traits_2; +using Geom_traits_2 = CGAL::Arr_geodesic_arc_on_sphere_traits_2; #elif 0 -typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2 Geom_traits_2; +using Geom_traits_2 = CGAL::Arr_geodesic_arc_on_sphere_traits_2; #else -typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2 Geom_traits_2; +using Geom_traits_2 = CGAL::Arr_geodesic_arc_on_sphere_traits_2; #endif -typedef Geom_traits_2::Point_2 Point_2; -typedef Geom_traits_2::X_monotone_curve_2 X_monotone_curve_2; -typedef CGAL::Arr_spherical_topology_traits_2 Topol_traits_2; -typedef CGAL::Arrangement_on_surface_2 - Arrangement_2; -typedef Arrangement_2::Vertex_handle Vertex_handle; +using Point_2 = Geom_traits_2::Point_2; +using X_monotone_curve_2 = Geom_traits_2::X_monotone_curve_2; +using Topol_traits_2 = CGAL::Arr_spherical_topology_traits_2; +using Arrangement_2 = + CGAL::Arrangement_on_surface_2; +using Vertex_handle = Arrangement_2::Vertex_handle; int main() { Geom_traits_2 traits; - Geom_traits_2::Construct_point_2 ctr_p = traits.construct_point_2_object(); - Geom_traits_2::Construct_x_monotone_curve_2 ctr_xcv = - traits.construct_x_monotone_curve_2_object(); + auto ctr_p = traits.construct_point_2_object(); + auto ctr_xcv = traits.construct_x_monotone_curve_2_object(); - std::vector< Point_2 > points; - std::vector< X_monotone_curve_2 > xcvs; + std::vector points; + std::vector xcvs; CGAL::IO::set_pretty_mode(std::cout); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp index 783ef0a48f3e..e341758c75ec 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_insert.cpp @@ -10,12 +10,12 @@ #include "arr_print.h" -typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; -typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2 Geom_traits; -typedef Geom_traits::Point_2 Point; -typedef Geom_traits::Curve_2 Curve; -typedef CGAL::Arr_spherical_topology_traits_2 Topol_traits; -typedef CGAL::Arrangement_on_surface_2 Arrangement; +using Kernel = CGAL::Exact_predicates_exact_constructions_kernel; +using Geom_traits = CGAL::Arr_geodesic_arc_on_sphere_traits_2; +using Point = Geom_traits::Point_2; +using Curve = Geom_traits::Curve_2; +using Topol_traits = CGAL::Arr_spherical_topology_traits_2; +using Arrangement = CGAL::Arrangement_on_surface_2; int main() { // Construct the arrangement from 12 geodesic arcs. @@ -46,7 +46,6 @@ int main() { CGAL::insert(arr, arcs.begin(), arcs.end()); print_arrangement_size(arr); // print the arrangement size - // print_arrangement(arr); return 0; } diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp index 2f5f6430dee9..ba27599b22d3 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/spherical_overlay.cpp @@ -7,7 +7,7 @@ #include "arr_geodesic_on_sphere.h" -typedef CGAL::Arr_default_overlay_traits Overlay_traits; +using Overlay_traits = CGAL::Arr_default_overlay_traits; int main() { Geom_traits traits; diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp index 351e5c7e004f..100c8828e398 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/tracing_counting.cpp @@ -9,9 +9,9 @@ #include "arr_exact_construction_segments.h" -typedef CGAL::Arr_tracing_traits_2 Tracing_traits; -typedef CGAL::Arr_counting_traits_2 Geom_traits; -typedef CGAL::Arrangement_2 My_arrangement; +using Tracing_traits = CGAL::Arr_tracing_traits_2; +using Geom_traits = CGAL::Arr_counting_traits_2; +using My_arrangement = CGAL::Arrangement_2; int main() { const Segment s1(Point(0, 0), Point(2, 2)); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp index 0b31dc9655bf..e870a714ccc1 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unb_planar_vertical_decomposition.cpp @@ -8,12 +8,12 @@ #include "arr_linear.h" -typedef std::variant Cell_type; -typedef std::optional Vert_decomp_type; -typedef std::pair Vert_decomp_pair; -typedef std::pair Vert_decomp_entry; -typedef std::list Vert_decomp_list; +using Cell_type = std::variant; +using Vert_decomp_type = std::optional; +using Vert_decomp_pair = std::pair; +using Vert_decomp_entry = std::pair; +using Vert_decomp_list = std::list; int main() { // Construct the arrangement. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp index a0b0912a6d63..e4e415bd8254 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/vertical_ray_shooting.cpp @@ -8,8 +8,8 @@ #include "arr_inexact_construction_segments.h" #include "point_location_utils.h" -typedef CGAL::Arr_walk_along_line_point_location Walk_pl; -typedef CGAL::Arr_trapezoid_ric_point_location Trap_pl; +using Walk_pl = CGAL::Arr_walk_along_line_point_location; +using Trap_pl = CGAL::Arr_trapezoid_ric_point_location; int main() { // Construct the arrangement. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h index 3576237f6996..a850f5ef3c88 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_conic_traits_2.h @@ -141,15 +141,15 @@ class Arr_conic_traits_2 { /*! Obtain the rational kernel. */ - Shared_rat_kernel rat_kernel() { return m_rat_kernel; } + Shared_rat_kernel rat_kernel() const { return m_rat_kernel; } /*! Obtain the algebraic kernel. */ - Shared_alg_kernel alg_kernel() { return m_alg_kernel; } + Shared_alg_kernel alg_kernel() const { return m_alg_kernel; } /*! Obtain the nt traits. */ - Shared_nt_traits nt_traits() { return m_nt_traits; } + Shared_nt_traits nt_traits() const { return m_nt_traits; } /*! Obtain the next conic index. */ static size_t get_index() { @@ -2258,7 +2258,7 @@ class Arr_conic_traits_2 { */ Curve_2 operator()(const Rational& r, const Rational& s, const Rational& t, const Rational& u, const Rational& v, const Rational& w, - const Orientation& orient, + Orientation orient, const Point_2& source, const Point_2& target) const { // Make sure that the source and the taget are not the same. const auto alg_kernel = m_traits.m_alg_kernel; @@ -2280,7 +2280,7 @@ class Arr_conic_traits_2 { * \pre The three points must not be collinear. */ Curve_2 operator()(const Rat_point_2& p1, const Rat_point_2& p2, - const Rat_point_2& p3) { + const Rat_point_2& p3) const { Curve_2 arc; // Set the source and target. @@ -2363,7 +2363,7 @@ class Arr_conic_traits_2 { */ Curve_2 operator()(const Rat_point_2& p1, const Rat_point_2& p2, const Rat_point_2& p3, const Rat_point_2& p4, - const Rat_point_2& p5) { + const Rat_point_2& p5) const { Curve_2 arc; // Make sure that no three points are collinear. @@ -2457,7 +2457,7 @@ class Arr_conic_traits_2 { */ Curve_2 operator()(const Rational& r, const Rational& s, const Rational& t, const Rational& u, const Rational& v, const Rational& w, - const Orientation& orient, + Orientation orient, const Point_2& app_source, const Rational& r_1, const Rational& s_1, const Rational& t_1, const Rational& u_1, @@ -2724,9 +2724,8 @@ class Arr_conic_traits_2 { * \pre The source and the target must be on the conic boundary and must * not be the same. */ - Curve_2 operator()(const Rat_circle_2& circ, const Orientation& orient, + Curve_2 operator()(const Rat_circle_2& circ, Orientation orient, const Point_2& source, const Point_2& target) const { - // Make sure that the source and the taget are not the same. CGAL_precondition_code(auto cmp_xy = m_traits.m_alg_kernel->compare_xy_2_object()); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h index d0a68b2885ba..b4ecc559815d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h @@ -247,27 +247,32 @@ class Arr_curve_data_traits_2 : public Traits_ { private: const Base_traits_2& m_base; - /*! Generate a helper class template to find out whether the base geometry - * traits has a nested type named Are_mergeable_2. - */ - BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_are_mergeable_2, - Are_mergeable_2, false) + template + bool are_mergeable_data(const T& /* cv1 */, const T& /* cv2 */, long) const { + CGAL_error_msg("Equality operator is not supported."); + return false; + } + + template + auto are_mergeable_data(const T& cv1, const T& cv2, int) const -> + decltype(cv1.data() == cv2.data()) + { return cv1.data() == cv2.data(); } /*! Implementation of the predicate in case the base geometry traits class * has a nested type named Are_mergeable_2. */ template - std::enable_if_t::value,bool> - are_mergeable(const X_monotone_curve_2& cv1, - const X_monotone_curve_2& cv2) const - { + auto are_mergeable(const X_monotone_curve_2& cv1, + const X_monotone_curve_2& cv2, + const GeomeTraits_2& traits, int) const -> + decltype(traits.are_mergeable_2_object(), bool()) { // In case the two base curves are not mergeable, the extended curves // are not mergeable as well. - if (! (m_base.are_mergeable_2_object()(cv1, cv2))) return false; + if (! (traits.are_mergeable_2_object()(cv1, cv2))) return false; // In case the two base curves are mergeable, check that they have the // same data fields. - return (cv1.data() == cv2.data()); + return are_mergeable_data(cv1, cv2, 0); } /*! Implementation of the predicate in case the base geometry traits class @@ -275,10 +280,9 @@ class Arr_curve_data_traits_2 : public Traits_ { * This function should never be called! */ template - std::enable_if_t::value,bool> - are_mergeable(const X_monotone_curve_2& /* cv1 */, - const X_monotone_curve_2& /* cv2 */) const - { + bool are_mergeable(const X_monotone_curve_2& /* cv1 */, + const X_monotone_curve_2& /* cv2 */, + const GeomeTraits_2& /* traits */, long) const { CGAL_error_msg("Are mergeable is not supported."); return false; } @@ -294,7 +298,7 @@ class Arr_curve_data_traits_2 : public Traits_ { */ bool operator()(const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2) const - { return are_mergeable(cv1, cv2); } + { return are_mergeable(cv1, cv2, m_base, 0); } }; /*! Obtain an Are_mergeable_2 functor object. */ diff --git a/Boolean_set_operations_2/include/CGAL/IO/Gps_iostream.h b/Boolean_set_operations_2/include/CGAL/IO/Gps_iostream.h index eae28c242a14..85847e0574f7 100644 --- a/Boolean_set_operations_2/include/CGAL/IO/Gps_iostream.h +++ b/Boolean_set_operations_2/include/CGAL/IO/Gps_iostream.h @@ -19,30 +19,61 @@ #include #include +#include #include #include namespace CGAL { -template -std::ostream & operator<< (std::ostream& os, - const CGAL::General_polygon_set_2 & pgn_set) -{ - typedef typename CGAL::General_polygon_set_2::Polygon_with_holes_2 - Polygon_with_holes_2; - typedef std::list Pgn_with_holes_container; - - Pgn_with_holes_container res; - pgn_set.polygons_with_holes (std::back_inserter (res)); +/*! Inserter operator for general polygons sets. + * Inserts a general polygon set into an output stream. + * \param os the output stream. + * \param pgn_set the general polygon set. + * \return the output stream. + */ +template +std::ostream& +operator<<(std::ostream& os, + const CGAL::General_polygon_set_2& pgn_set) { + using Geometry_traits_2 = GeomTraits_; + using Dcel = Dcel_; + using Gps = CGAL::General_polygon_set_2; + using Pwh_2 = typename Gps::Polygon_with_holes_2; + using Pgn_with_holes_container = std::list; + Pgn_with_holes_container pwhs; + pgn_set.polygons_with_holes(std::back_inserter(pwhs)); std::cout << pgn_set.number_of_polygons_with_holes() << std::endl; - std::copy(res.begin(), res.end(), - std::ostream_iterator(std::cout, "\n")); - + std::copy(pwhs.begin(), pwhs.end(), std::ostream_iterator(os, "\n")); return os; } +/*! Extractor operator for general polygons sets. + * Extracts a general polygon set from an input stream. + * \param is the input stream. + * \param pgn_set the general polygon set. + * \return the input stream. + */ +template +std::istream& +operator>>(std::istream& is, + CGAL::General_polygon_set_2& pgn_set) { + using Geometry_traits_2 = GeomTraits_; + using Dcel = Dcel_; + using Gps = CGAL::General_polygon_set_2; + using Pwh_2 = typename Gps::Polygon_with_holes_2; + + int n; + is >> n; + for (int i = 0; i < n; ++i) { + Pwh_2 pwh; + is >> pwh; + pgn_set.insert(pwh); + } + return is; +} + } //namespace CGAL #include diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2.h index a816ba72255e..1c1d0df3a067 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2.h @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor_base.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor_base.h index 87710c95ec30..441e96824887 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor_base.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor_base.h @@ -84,7 +84,7 @@ class Default_visitor_base { /*! Destructor */ virtual ~Default_visitor_base() {} - /*! Attach the a sweep-line object. */ + /*! Attach a sweep-line object. */ void attach(Surface_sweep_2* sl) { m_surface_sweep = sl; } /*!