Merge pull request #7841 from efifogel/Aos_2-fixes-efif

Aos_2 fixes, by Efi
This commit is contained in:
Laurent Rineau 2023-11-29 17:23:18 +01:00
commit 3cdaeee778
63 changed files with 678 additions and 575 deletions

View File

@ -2,98 +2,95 @@
\input{header} \input{header}
\pagestyle{empty} \pagestyle{empty}
\begin{document} \begin{document}
\psscalebox{1.8}{\arrset{0.8} \begin{tikzpicture}[scale=1.0,thick]
\pspicture[](-0.2,-0.2)(12.2,12.2) \node[point] at ( 1, 3) (a) {};
%\psgrid(0,0)(12,12) \node[point] at ( 2, 4) (b) {};
\arrMainVertex( 1, 3){a} \node[point] at ( 0, 6) (c) {};
\arrMainVertex( 2, 4){b} \node [point,label={[label distance=0pt]90:{$v_1$}}] at ( 5,11) (1) {};
\arrMainVertex( 0, 6){c} \node[point] at ( 9,11) (f) {};
\arrv[90](5,11){1} \node[point] at (12, 8) (g) {};
\arrMainVertex(9,11){f} \node [point,label={[label distance=0pt]-45:{$v_2$}}] at ( 8, 8) (2) {};
\arrMainVertex(12, 8){g} \node[point] at ( 8, 4) (i) {};
\arrv[-60](8,8){2} \node[point] at ( 6, 4) (j) {};
\arrMainVertex( 8, 4){i} \node[point] at ( 6, 2) (k) {};
\arrMainVertex( 6, 4){j} \node[point] at ( 4, 0) (m) {};
\arrMainVertex( 6, 2){k} \node[point] at ( 9, 0) (n) {};
\arrMainVertex( 4, 0){m} \node[point] at (11, 2) (o) {};
\arrMainVertex( 9, 0){n} \node[point] at (12, 4) (p) {};
\arrMainVertex(11, 2){o} \node[point] at (12, 0) (q) {};
\arrMainVertex(12, 4){p} \node[point] at ( 4, 2) (r) {};
\arrMainVertex(12, 0){q} \node[point] at ( 3, 3) (s) {};
\arrMainVertex( 4, 2){r} \node[point] at ( 5, 3) (t) {};
\arrMainVertex( 3, 3){s}
\arrMainVertex( 5, 3){t}
% %
\ncline[linewidth=0.5pt,linecolor=blue]{a}{b} \draw[blue] (a)--(b);
\ncline[linewidth=0.5pt,linecolor=blue]{b}{c} \draw[blue] (b)--(c);
\ncline[linewidth=0.5pt,linecolor=blue]{c}{1} \draw[blue] (c)--(1);
\ncline[linewidth=0.5pt,linecolor=blue]{1}{f} \draw[blue] (1)--(f);
\ncline[linewidth=0.5pt,offset=3pt,nodesepB=6pt]{->}{f}{1}\Aput[1pt]{$e_{\mathrm{prev}}$} \draw [halfedge,shorten >=4pt] (f) to node[sloped,below]{$e_{\mathrm{prev}}$} (1);
\ncline[linewidth=0.5pt,linecolor=blue]{f}{g} \draw[blue] (f)--(g);
\ncline[linewidth=0.5pt,linecolor=blue]{g}{2} \draw[blue] (g)--(2);
\ncline[linewidth=0.5pt,linecolor=blue]{g}{2} \draw [halfedge,shorten >=4pt] (2) to node[sloped,above]{$e_{\mathrm{next}}$} (g);
\ncline[linewidth=0.5pt,offset=3pt,nodesepB=4pt]{->}{2}{g}\Aput[1pt]{$e_{\mathrm{next}}$} \draw[blue] (2)--(i);
\ncline[linewidth=0.5pt,linecolor=blue]{2}{i} \draw[blue] (i)--(j);
\ncline[linewidth=0.5pt,linecolor=blue]{i}{j} \draw[blue] (j)--(k);
\ncline[linewidth=0.5pt,linecolor=blue]{j}{k} \draw[blue] (k)--(m);
\ncline[linewidth=0.5pt,linecolor=blue]{k}{m} \draw[blue] (m)--(a);
\ncline[linewidth=0.5pt,linecolor=blue]{m}{a} \draw[blue] (1)--(2);
\ncline[linewidth=0.5pt,linecolor=blue]{1}{2} \draw[blue] (g)--(i);
\ncline[linewidth=0.5pt,linecolor=blue]{g}{i} \draw[blue] (m)--(n);
\ncline[linewidth=0.5pt,linecolor=blue]{m}{n} \draw[blue] (n)--(i);
\ncline[linewidth=0.5pt,linecolor=blue]{n}{i} \draw[blue] (g)--(n);
\ncline[linewidth=0.5pt,linecolor=blue]{g}{n} \draw[blue] (n)--(o);
\ncline[linewidth=0.5pt,linecolor=blue]{n}{o} \draw[blue] (o)--(p);
\ncline[linewidth=0.5pt,linecolor=blue]{o}{p} \draw[blue] (p)--(q);
\ncline[linewidth=0.5pt,linecolor=blue]{p}{q} \draw[blue] (q)--(o);
\ncline[linewidth=0.5pt,linecolor=blue]{q}{o} \draw[blue] (r)--(s);
\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}
% %
\ncline[linewidth=0.5pt,offset=3pt]{->}{b}{a} \path [halfedge] (r) edge (s);
\ncline[linewidth=0.5pt,offset=3pt]{->}{c}{b} \path [halfedge] (s) edge (r);
\ncline[linewidth=0.5pt,offset=3pt]{->}{1}{c} \draw [blue] (r)--(t);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=4pt]{->}{g}{f} \path [halfedge] (r) edge (t);
\ncline[linewidth=0.5pt,offset=3pt]{->}{i}{2} \path [halfedge] (t) edge (r);
\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'$}
% %
\rput(2,10){$f_0$} \path [halfedge] (b) edge (a);
\rput(3,4){$f_1$} \path [halfedge] (c) edge (b);
\rput(8.5,9.5){$f_2$} \path [halfedge] (1) edge (c);
\rput(5,7){$f_3$} \path [halfedge,shorten <=4pt] (g) edge (f);
\rput(4.5,5.6){$f_4$} \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} \node at (2,10){$f_0$};
\arru[90](5,9){2} \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} \node [point,label={[label distance=0pt]90:{$u_1$}}] at (2,6) (1) {};
\arrMainVertex(4,7){b} \node [point,label={[label distance=0pt]90:{$u_2$}}] at (5,9) (1) {};
\arrMainVertex(5,8){c} %
\arrMainVertex(5,4){f} \node[point] at (4,5) (a) {};
\arrMainVertex(5,6){e} \node[point] at (4,7) (b) {};
\arrMainVertex(6,7){d} \node[point] at (5,8) (c) {};
\ncline[linewidth=0.5pt,linecolor=blue]{a}{b} \node[point] at (5,4) (f) {};
\ncline[linewidth=0.5pt,linecolor=blue]{b}{c} \node[point] at (5,6) (e) {};
\ncline[linewidth=0.5pt,linecolor=blue]{c}{d} \node[point] at (6,7) (d) {};
\ncline[linewidth=0.5pt,linecolor=blue]{d}{e} \draw[blue] (a)--(b);
\ncline[linewidth=0.5pt,linecolor=blue]{e}{f} \draw[blue] (b)--(c);
\ncline[linewidth=0.5pt,linecolor=blue]{f}{a} \draw[blue] (c)--(d);
\ncline[linewidth=0.5pt,linecolor=blue]{b}{e} \draw[blue] (d)--(e);
\ncline[linewidth=0.5pt,offset=3pt]{->}{a}{b} \draw[blue] (e)--(f);
\ncline[linewidth=0.5pt,offset=3pt]{->}{b}{c} \draw[blue] (f)--(a);
\ncline[linewidth=0.5pt,offset=3pt]{->}{c}{d} \draw[blue] (b)--(e);
\ncline[linewidth=0.5pt,offset=3pt]{->}{d}{e} \path [halfedge] (a) edge (b);
\ncline[linewidth=0.5pt,offset=3pt]{->}{e}{f} \path [halfedge] (b) edge (c);
\ncline[linewidth=0.5pt,offset=3pt]{->}{f}{a} \path [halfedge] (c) edge (d);
\endpspicture \path [halfedge] (d) edge (e);
} \path [halfedge] (e) edge (f);
\path [halfedge] (f) edge (a);
\end{tikzpicture}%
\end{document} \end{document}

View File

@ -2,7 +2,7 @@
\input{header} \input{header}
\pagestyle{empty} \pagestyle{empty}
\begin{document} \begin{document}
\psscalebox{1.8}{\arrset{1}% \psscalebox{1}{\arrset{1}%
\def\bodyBezier{ \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](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) \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)

View File

@ -43,10 +43,25 @@
\usepackage{tikz} \usepackage{tikz}
\usepackage{pgfplots} \usepackage{pgfplots}
\usepackage{mathptmx} \usepackage{mathptmx}
\usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings,matrix,fit,decorations.pathreplacing,arrows,automata,positioning,shapes,chains,spy} \usetikzlibrary{calc}
%\usetikzlibrary{quotes,angles,graph} \usetikzlibrary{backgrounds}
\usetikzlibrary{intersections,through,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} \usepackage{tikz-3dplot}
%\usetikzlibrary{quotes,angles,graph}
\tikzset{% \tikzset{%
invisible/.style={opacity=0}, invisible/.style={opacity=0},
only/.code args={<#1>#2}{\only<#1>{\pgfkeysalso{#2}}}, only/.code args={<#1>#2}{\only<#1>{\pgfkeysalso{#2}}},
@ -54,8 +69,49 @@
temporal/.code args={<#1>#2#3#4}{% temporal/.code args={<#1>#2#3#4}{%
\temporal<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}{\pgfkeysalso{#4}}}, \temporal<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}{\pgfkeysalso{#4}}},
point/.style={circle,inner sep=1.5pt,minimum size=1.5pt,draw,fill=#1}, 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 \makeatletter
\def\nodesDef{\@ifnextchar[{\@nodesDefWith}{\@nodesDefWithout}} \def\nodesDef{\@ifnextchar[{\@nodesDefWith}{\@nodesDefWithout}}
\def\@nodesDefWith[#1]#2{\foreach \c in #2 { \node[point=#1] (n\c) at (\c) {}; }} \def\@nodesDefWith[#1]#2{\foreach \c in #2 { \node[point=#1] (n\c) at (\c) {}; }}
@ -81,6 +137,7 @@
% \usepackage{picins} % \usepackage{picins}
\usepackage[absolute,overlay]{textpos} \usepackage[absolute,overlay]{textpos}
\usepackage{ifthen} \usepackage{ifthen}
\usepackage{xparse}
\usepackage{etoolbox} \usepackage{etoolbox}
% %

View File

@ -2,96 +2,92 @@
\input{header} \input{header}
\pagestyle{empty} \pagestyle{empty}
\begin{document} \begin{document}
\psscalebox{1.8}{\arrset{0.5}% \begin{tabular}{ccc}
\begin{tabular}{ccc} \begin{tikzpicture}
\pspicture[](0.5,0)(10,7) \node[point] at (1,4) (a) {};
\arrMainVertex(1,4){a} \node[point] at (5,6) (b) {};
\arrMainVertex(5,6){b} \node[point] at (9,4) (c) {};
\arrMainVertex(9,4){c} \node[point] at (7,2) (d) {};
\arrMainVertex(7,2){d} \node[point] at (3,1) (e) {};
\arrMainVertex(3,1){e} \node[point] at (3,2) (f) {};
\arrMainVertex(3,2){f} \draw[blue,very thick](a)--(b);
\ncline[linewidth=0.5pt,linecolor=blue]{a}{b} \draw[blue,very thick](b)--(c);
\ncline[linewidth=0.5pt,linecolor=blue]{b}{c} \draw[blue,very thick](c)--(d);
\ncline[linewidth=0.5pt,linecolor=blue]{c}{d} \draw[blue,very thick](d)--(e);
\ncline[linewidth=0.5pt,linecolor=blue]{d}{e} \draw[blue,very thick](e)--(f);
\ncline[linewidth=0.5pt,linecolor=blue]{e}{f} \draw[blue,very thick](f)--(a);
\ncline[linewidth=0.5pt,linecolor=blue]{f}{a} \node[point=cyan,label={[label distance=0pt]135:{$v_1$}}] at (3,3) (1) {};
\arrMinorVertex(3,3){1}\uput[135]{0}(3,3){$v_1$} \node[point=cyan,label={[label distance=0pt]135:{$v_2$}}] at (6,4) (2) {};
\arrMinorVertex(6,4){2}\uput[-45]{0}(6,4){$v_2$} \draw[dashed,blue,very thick] (1)--(2);
\ncline[linestyle=dashed,linewidth=0.5pt,linecolor=blue]{1}{2} \draw[halfedge] (1) to (2);
\ncline[linewidth=0.5pt,offset=3pt]{->}{1}{2} \draw[halfedge] (2) to (1);
\ncline[linewidth=0.5pt,offset=3pt]{->}{2}{1} \node at (5,5) {$f$};
\rput(5,5){$f$} \draw[thin](0.5,0) rectangle (10,7);
\psframe[linewidth=0.5pt](0.5,0)(10,7) \end{tikzpicture} &
\endpspicture & %
% \begin{tikzpicture}
\pspicture[](0.5,0)(10,7) \node[point] at (1,3) (a) {};
\arrMainVertex(1,3){a} \node[point] at (2,5) (b) {};
\arrMainVertex(2,5){b} \node[point] at (5,6) (c) {};
\arrMainVertex(5,6){c} \node[point,label={[label distance=0pt]180:{$u$}}] at (7,3) (u) {};
\arrMainVertex(7,3){u} \node[point] at (5,1) (e) {};
\uput[180]{0}(7,3){$u$} \node[point] at (3,2) (f) {};
\arrMainVertex(5,1){e} \node[point] at (2,1) (g) {};
\arrMainVertex(3,2){f} \draw[blue,very thick](a)--(b);
\arrMainVertex(2,1){g} \draw[blue,very thick](b)--(c);
\ncline[linewidth=0.5pt,linecolor=blue]{a}{b} \draw[blue,very thick](c)--(u);
\ncline[linewidth=0.5pt,linecolor=blue]{b}{c} \draw[blue,very thick](u)--(e);
\ncline[linewidth=0.5pt,linecolor=blue]{c}{u} \draw[blue,very thick](e)--(f);
\ncline[linewidth=0.5pt,linecolor=blue]{u}{e} \draw[blue,very thick](f)--(g);
\ncline[linewidth=0.5pt,linecolor=blue]{e}{f} \draw[blue,very thick](g)--(a);
\ncline[linewidth=0.5pt,linecolor=blue]{f}{g} \node[point=cyan,label={[label distance=0pt]90:{$v$}}] at (9,4) (v) {};
\ncline[linewidth=0.5pt,linecolor=blue]{g}{a} \draw[dashed,blue,very thick] (u)--(v);
\arrMinorVertex(9,4){v} \draw[dashed,halfedge] (c) to (u);
\uput[90]{0}(9,4){$v$} \draw[dashed,halfedge] (u) to (e);
\ncline[linestyle=dashed,linewidth=0.5pt,linecolor=blue]{u}{v} \draw[halfedge] (u) to (v);
\ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt]{->}{c}{u} \draw[halfedge] (v) to (u);
\ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt]{->}{u}{e} \draw[thin] (0.5,0) rectangle (10,7);
\ncline[linewidth=0.5pt,offset=3pt]{->}{u}{v} \end{tikzpicture} &
\ncline[linewidth=0.5pt,offset=3pt]{->}{v}{u} %
\psframe[linewidth=0.5pt](0.5,0)(10,7) \begin{tikzpicture}
\endpspicture & \node[point] at (1,3) (a) {};
% \node[point] at (2,6) (b) {};
\pspicture[](0.5,0)(10,7) \node[point,label={[label distance=0pt]45:{$u_1$}}] at (5,6) (1) {};
\arrMainVertex(1,3){a} \node[point,label={[label distance=0pt]45:{$u_2$}}] at (7,1) (2) {};
\arrMainVertex(2,6){b} \node[point] at (4,2) (e) {};
\arru[45](5,6){1} \node[point] at (2,1) (f) {};
\arru[-45](7,1){2} \draw[blue,very thick](a)--(b);
\arrMainVertex(4,2){e} \draw[blue,very thick](b)--(1);
\arrMainVertex(2,1){f} \draw[dashed,thick,halfedge] (b) to (1);
\ncline[linewidth=0.5pt,linecolor=blue]{a}{b} \draw[dashed,thick,halfedge] (1) to (b);
\ncline[linewidth=0.5pt,linecolor=blue]{b}{1} \draw[dashed,blue,very thick](1)--(2);
\ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt]{->}{b}{1} \draw[thick,halfedge] (1) to (2);
\ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt]{->}{1}{b} \draw[thick,halfedge,shorten <=4pt] (2) to (1);
\ncline[linestyle=dashed,linewidth=0.5pt,linecolor=blue]{1}{2} \draw[blue,very thick] (2)--(e);
\ncline[linewidth=0.5pt,offset=3pt]{->}{1}{2} \draw[dashed,halfedge] (2) to (e);
\ncline[linewidth=0.5pt,offset=3pt,nodesepA=6pt]{->}{2}{1} \draw[dashed,halfedge,shorten >=4pt] (e) to (2);
\ncline[linewidth=0.5pt,linecolor=blue]{2}{e} \draw[blue,very thick] (e)--(f);
\ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt]{->}{2}{e} \draw[blue,very thick] (f)--(a);
\ncline[linestyle=dashed,linewidth=0.5pt,offset=3pt,nodesepB=4pt]{->}{e}{2} \node[point] at (2.5,4) (a) {};
\ncline[linewidth=0.5pt,linecolor=blue]{e}{f} \node[point] at (3.5,5) (b) {};
\ncline[linewidth=0.5pt,linecolor=blue]{f}{a} \node[point] at (4.5,4) (c) {};
\arrMainVertex(2.5,4){a} \node[point] at (3.5,3) (d) {};
\arrMainVertex(3.5,5){b} \draw[blue,very thick](a)--(b);
\arrMainVertex(4.5,4){c} \draw[blue,very thick](b)--(c);
\arrMainVertex(3.5,3){d} \draw[blue,very thick](c)-- node[midway,below,sloped] {$h_1$} (d);
\ncline[linewidth=0.5pt,linecolor=blue]{a}{b} \draw[blue,very thick](d)--(a);
\ncline[linewidth=0.5pt,linecolor=blue]{b}{c} \draw[blue,very thick](a)--(c);
\ncline[linewidth=0.5pt,linecolor=blue]{c}{d}\Aput[1pt]{$h_1$} \node at (1,5) {$f$};
\ncline[linewidth=0.5pt,linecolor=blue]{d}{a} \node at (2.5,5) {$f'$};
\ncline[linewidth=0.5pt,linecolor=blue]{a}{c} \node[point] at (7,4) (a) {};
\rput(1,5){$f$} \node[point] at (8,4) (b) {};
\rput(2.5,5){$f'$} \node[point] at (8,5) (c) {};
\arrMainVertex(7,4){a} \node[point] at (9,3) (d) {};
\arrMainVertex(8,4){b} \draw[blue,very thick] (a)--(b);
\arrMainVertex(8,5){c} \draw[blue,very thick] (b)--(c);
\arrMainVertex(9,3){d} \draw[blue,very thick] (c)--(a);
\ncline[linewidth=0.5pt,linecolor=blue]{a}{b} \draw[blue,very thick] (b)-- node[midway,below,sloped] {$h_2$} (d);
\ncline[linewidth=0.5pt,linecolor=blue]{b}{c} \draw[thin] (0.5,0) rectangle (10,7);
\ncline[linewidth=0.5pt,linecolor=blue]{c}{a} \end{tikzpicture}
\ncline[linewidth=0.5pt,linecolor=blue]{b}{d}\Aput[1pt]{$h_2$} \end{tabular}
\psframe[linewidth=0.5pt](0.5,0)(10,7)
\endpspicture
\end{tabular}
}
\end{document} \end{document}

View File

@ -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}

View File

@ -49,7 +49,9 @@ TARGETS = \
overlay_color.pdf \ overlay_color.pdf \
bgl_primal_adapter.pdf \ bgl_primal_adapter.pdf \
bgl_dual_adapter.pdf \ bgl_dual_adapter.pdf \
unb_asymptote.pdf unb_asymptote.pdf \
min_area_tri.pdf \
jeep.pdf
.DEFAULT_GOAL = all .DEFAULT_GOAL = all
.PHONY: all clean .PHONY: all clean

View File

@ -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}

View File

@ -4,15 +4,15 @@
#include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/property_map.h> #include <CGAL/property_map.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
typedef Kernel::FT Number_type; using Number_type = Kernel::FT;
template <typename Arrangement> struct Edge_length { template <typename Arrangement> struct Edge_length {
// Boost property-type definitions. // Boost property-type definitions.
typedef boost::readable_property_map_tag category; using category = boost::readable_property_map_tag;
typedef Number_type value_type; using value_type = Number_type;
typedef value_type reference; using reference = value_type;
typedef typename Arrangement::Halfedge_handle key_type; using key_type = typename Arrangement::Halfedge_handle;
value_type operator()(typename Arrangement::Halfedge_handle e) const { value_type operator()(typename Arrangement::Halfedge_handle e) const {
const auto diff_x = e->target()->point().x() - e->source()->point().x(); const auto diff_x = e->target()->point().x() - e->source()->point().x();

View File

@ -4,13 +4,13 @@
// A property map that reads/writes the information to/from the extended face. // A property map that reads/writes the information to/from the extended face.
template <typename Arrangement, class Type> class Extended_face_property_map { template <typename Arrangement, class Type> class Extended_face_property_map {
public: public:
typedef typename Arrangement::Face_handle Face_handle; using Face_handle = typename Arrangement::Face_handle;
// Boost property type definitions. // Boost property type definitions.
typedef boost::read_write_property_map_tag category; using category = boost::read_write_property_map_tag;
typedef Type value_type; using value_type = Type;
typedef value_type& reference; using reference = value_type&;
typedef Face_handle key_type; using key_type = Face_handle;
// The get function is required by the property map concept. // The get function is required by the property map concept.
friend reference get(const Extended_face_property_map& /* map */, key_type key) friend reference get(const Extended_face_property_map& /* map */, key_type key)

View File

@ -2,13 +2,13 @@
#define OVERLAY_COLOR_TRAITS_H #define OVERLAY_COLOR_TRAITS_H
template <typename Arrangement> struct Overlay_color_traits { template <typename Arrangement> struct Overlay_color_traits {
typedef unsigned int Color; using Color = unsigned int;
typedef typename Arrangement::Vertex_const_handle V_const_handle; using V_const_handle = typename Arrangement::Vertex_const_handle;
typedef typename Arrangement::Halfedge_const_handle H_const_handle; using H_const_handle = typename Arrangement::Halfedge_const_handle;
typedef typename Arrangement::Face_const_handle F_const_handle; using F_const_handle = typename Arrangement::Face_const_handle;
typedef typename Arrangement::Vertex_handle V_handle; using V_handle = typename Arrangement::Vertex_handle;
typedef typename Arrangement::Halfedge_handle H_handle; using H_handle = typename Arrangement::Halfedge_handle;
typedef typename Arrangement::Face_handle F_handle; using F_handle = typename Arrangement::Face_handle;
// Compute the average of the red, green, and blue components separately. // Compute the average of the red, green, and blue components separately.
Color blend(Color color1, Color color2) const Color blend(Color color1, Color color2) const

View File

@ -21,10 +21,10 @@ int main ()
#include "integer_type.h" #include "integer_type.h"
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Arr_algebraic_segment_traits_2<Integer> Traits; using Traits = CGAL::Arr_algebraic_segment_traits_2<Integer>;
typedef CGAL::Arrangement_2<Traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Traits>;
typedef Traits::Curve_2 Curve; using Curve = Traits::Curve_2;
typedef Traits::Polynomial_2 Polynomial; using Polynomial = Traits::Polynomial_2;
int main() { int main() {
CGAL::IO::set_pretty_mode(std::cout); // for nice printouts. CGAL::IO::set_pretty_mode(std::cout); // for nice printouts.

View File

@ -21,15 +21,15 @@ int main ()
#include "integer_type.h" #include "integer_type.h"
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Arr_algebraic_segment_traits_2<Integer> Traits; using Traits = CGAL::Arr_algebraic_segment_traits_2<Integer>;
typedef CGAL::Arrangement_2<Traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Traits>;
typedef Traits::Curve_2 Curve; using Curve = Traits::Curve_2;
typedef Traits::Polynomial_2 Polynomial; using Polynomial = Traits::Polynomial_2;
typedef Traits::Algebraic_real_1 Algebraic_real; using Algebraic_real = Traits::Algebraic_real_1;
typedef Traits::X_monotone_curve_2 X_monotone_curve; using X_monotone_curve = Traits::X_monotone_curve_2;
typedef Traits::Point_2 Point; using Point = Traits::Point_2;
typedef std::variant<Point, X_monotone_curve> Make_x_monotone_result; using Make_x_monotone_result = std::variant<Point, X_monotone_curve>;
int main() { int main() {
Traits traits; Traits traits;

View File

@ -6,17 +6,17 @@
#include <CGAL/Arr_Bezier_curve_traits_2.h> #include <CGAL/Arr_Bezier_curve_traits_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
typedef CGAL::CORE_algebraic_number_traits Nt_traits; using Nt_traits = CGAL::CORE_algebraic_number_traits;
typedef Nt_traits::Rational NT; using NT = Nt_traits::Rational;
typedef Nt_traits::Rational Rational; using Rational = Nt_traits::Rational;
typedef Nt_traits::Algebraic Algebraic; using Algebraic = Nt_traits::Algebraic;
typedef CGAL::Cartesian<Rational> Rat_kernel; using Rat_kernel = CGAL::Cartesian<Rational>;
typedef CGAL::Cartesian<Algebraic> Alg_kernel; using Alg_kernel = CGAL::Cartesian<Algebraic>;
typedef Rat_kernel::Point_2 Rat_point; using Rat_point = Rat_kernel::Point_2;
typedef CGAL::Arr_Bezier_curve_traits_2<Rat_kernel, Alg_kernel, Nt_traits> using Traits =
Traits; CGAL::Arr_Bezier_curve_traits_2<Rat_kernel, Alg_kernel, Nt_traits>;
typedef Traits::X_monotone_curve_2 Bezier_x_monotone_curve; using Bezier_x_monotone_curve = Traits::X_monotone_curve_2;
typedef Traits::Curve_2 Bezier_curve; using Bezier_curve = Traits::Curve_2;
typedef CGAL::Arrangement_2<Traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Traits>;
#endif #endif

View File

@ -5,16 +5,16 @@
#include <CGAL/Arr_circle_segment_traits_2.h> #include <CGAL/Arr_circle_segment_traits_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
typedef Kernel::FT Number_type; using Number_type = Kernel::FT;
typedef CGAL::Arr_circle_segment_traits_2<Kernel> Traits; using Traits = CGAL::Arr_circle_segment_traits_2<Kernel>;
typedef Traits::CoordNT CoordNT; using CoordNT = Traits::CoordNT;
typedef Traits::Point_2 Point; using Point = Traits::Point_2;
typedef Traits::Curve_2 Curve; using Curve = Traits::Curve_2;
typedef Traits::X_monotone_curve_2 X_monotone_curve; using X_monotone_curve = Traits::X_monotone_curve_2;
typedef Traits::Rational_point_2 Rational_point; using Rational_point = Traits::Rational_point_2;
typedef Traits::Rational_segment_2 Segment; using Segment = Traits::Rational_segment_2;
typedef Traits::Rational_circle_2 Circle; using Circle = Traits::Rational_circle_2;
typedef CGAL::Arrangement_2<Traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Traits>;
#endif #endif

View File

@ -5,19 +5,19 @@
#include <CGAL/Arr_segment_traits_2.h> #include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
typedef Kernel::FT Number_type; using Number_type = Kernel::FT;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits; using Traits = CGAL::Arr_segment_traits_2<Kernel>;
typedef Traits::Point_2 Point; using Point = Traits::Point_2;
typedef Traits::X_monotone_curve_2 Segment; using Segment = Traits::X_monotone_curve_2;
typedef CGAL::Arrangement_2<Traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Traits>;
typedef Arrangement::Vertex_handle Vertex_handle; using Vertex_handle = Arrangement::Vertex_handle;
typedef Arrangement::Halfedge_handle Halfedge_handle; using Halfedge_handle = Arrangement::Halfedge_handle;
typedef Arrangement::Face_handle Face_handle; using Face_handle = Arrangement::Face_handle;
typedef Arrangement::Vertex_const_handle Vertex_const_handle; using Vertex_const_handle = Arrangement::Vertex_const_handle;
typedef Arrangement::Halfedge_const_handle Halfedge_const_handle; using Halfedge_const_handle = Arrangement::Halfedge_const_handle;
typedef Arrangement::Face_const_handle Face_const_handle; using Face_const_handle = Arrangement::Face_const_handle;
#endif #endif

View File

@ -6,21 +6,20 @@
#include <CGAL/Arr_geodesic_arc_on_sphere_traits_2.h> #include <CGAL/Arr_geodesic_arc_on_sphere_traits_2.h>
#include <CGAL/Arr_spherical_topology_traits_2.h> #include <CGAL/Arr_spherical_topology_traits_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
typedef Kernel::FT Number_type; using Number_type = Kernel::FT;
typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel> Geom_traits; using Geom_traits = CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel>;
typedef Geom_traits::Point_2 Point; using Point = Geom_traits::Point_2;
typedef Geom_traits::X_monotone_curve_2 X_monotone_curve; using X_monotone_curve = Geom_traits::X_monotone_curve_2;
typedef CGAL::Arr_spherical_topology_traits_2<Geom_traits> Topol_traits; using Topol_traits = CGAL::Arr_spherical_topology_traits_2<Geom_traits>;
typedef CGAL::Arrangement_on_surface_2<Geom_traits, Topol_traits> using Arrangement = CGAL::Arrangement_on_surface_2<Geom_traits, Topol_traits>;
Arrangement;
typedef Arrangement::Vertex_handle Vertex_handle; using Vertex_handle = Arrangement::Vertex_handle;
typedef Arrangement::Halfedge_handle Halfedge_handle; using Halfedge_handle = Arrangement::Halfedge_handle;
typedef Arrangement::Face_handle Face_handle; using Face_handle = Arrangement::Face_handle;
typedef Arrangement::Vertex_const_handle Vertex_const_handle; using Vertex_const_handle = Arrangement::Vertex_const_handle;
typedef Arrangement::Halfedge_const_handle Halfedge_const_handle; using Halfedge_const_handle = Arrangement::Halfedge_const_handle;
typedef Arrangement::Face_const_handle Face_const_handle; using Face_const_handle = Arrangement::Face_const_handle;
#endif #endif

View File

@ -5,16 +5,16 @@
#include <CGAL/Arr_non_caching_segment_traits_2.h> #include <CGAL/Arr_non_caching_segment_traits_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
typedef Kernel::FT Number_type; using Number_type = Kernel::FT;
typedef CGAL::Arr_non_caching_segment_traits_2<Kernel> Traits; using Traits = CGAL::Arr_non_caching_segment_traits_2<Kernel>;
typedef Traits::Point_2 Point; using Point = Traits::Point_2;
typedef Traits::X_monotone_curve_2 Segment; using Segment = Traits::X_monotone_curve_2;
typedef CGAL::Arrangement_2<Traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Traits>;
typedef Arrangement::Vertex_handle Vertex_handle; using Vertex_handle = Arrangement::Vertex_handle;
typedef Arrangement::Halfedge_handle Halfedge_handle; using Halfedge_handle = Arrangement::Halfedge_handle;
typedef Arrangement::Face_handle Face_handle; using Face_handle = Arrangement::Face_handle;
#endif #endif

View File

@ -5,22 +5,22 @@
#include <CGAL/Arr_linear_traits_2.h> #include <CGAL/Arr_linear_traits_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
typedef Kernel::FT Number_type; using Number_type = Kernel::FT;
typedef CGAL::Arr_linear_traits_2<Kernel> Traits; using Traits = CGAL::Arr_linear_traits_2<Kernel>;
typedef Traits::Point_2 Point; using Point = Traits::Point_2;
typedef Traits::Segment_2 Segment; using Segment = Traits::Segment_2;
typedef Traits::Ray_2 Ray; using Ray = Traits::Ray_2;
typedef Traits::Line_2 Line; using Line = Traits::Line_2;
typedef Traits::X_monotone_curve_2 X_monotone_curve; using X_monotone_curve = Traits::X_monotone_curve_2;
typedef CGAL::Arrangement_2<Traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Traits>;
typedef Arrangement::Vertex_handle Vertex_handle; using Vertex_handle = Arrangement::Vertex_handle;
typedef Arrangement::Halfedge_handle Halfedge_handle; using Halfedge_handle = Arrangement::Halfedge_handle;
typedef Arrangement::Face_handle Face_handle; using Face_handle = Arrangement::Face_handle;
typedef Arrangement::Vertex_const_handle Vertex_const_handle; using Vertex_const_handle = Arrangement::Vertex_const_handle;
typedef Arrangement::Halfedge_const_handle Halfedge_const_handle; using Halfedge_const_handle = Arrangement::Halfedge_const_handle;
typedef Arrangement::Face_const_handle Face_const_handle; using Face_const_handle = Arrangement::Face_const_handle;
#endif #endif

View File

@ -6,14 +6,14 @@
#include <CGAL/Arr_polyline_traits_2.h> #include <CGAL/Arr_polyline_traits_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
typedef Kernel::FT Number_type; using Number_type = Kernel::FT;
typedef CGAL::Arr_segment_traits_2<Kernel> Segment_traits; using Segment_traits = CGAL::Arr_segment_traits_2<Kernel>;
typedef CGAL::Arr_polyline_traits_2<Segment_traits> Traits; using Traits = CGAL::Arr_polyline_traits_2<Segment_traits>;
typedef Traits::Point_2 Point; using Point = Traits::Point_2;
typedef Traits::Segment_2 Segment; using Segment = Traits::Segment_2;
typedef Traits::Curve_2 My_polyline; using My_polyline = Traits::Curve_2;
typedef CGAL::Arrangement_2<Traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Traits>;
#endif #endif

View File

@ -7,14 +7,14 @@
#include <CGAL/Arr_rational_function_traits_2.h> #include <CGAL/Arr_rational_function_traits_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
typedef CORE::BigInt Number_type; using Number_type = CORE::BigInt;
typedef CGAL::Algebraic_kernel_d_1<Number_type> AK1; using AK1 = CGAL::Algebraic_kernel_d_1<Number_type>;
typedef CGAL::Arr_rational_function_traits_2<AK1> Traits; using Traits = CGAL::Arr_rational_function_traits_2<AK1>;
typedef Traits::Polynomial_1 Polynomial; using Polynomial = Traits::Polynomial_1;
typedef Traits::Algebraic_real_1 Alg_real; using Alg_real = Traits::Algebraic_real_1;
typedef Traits::Bound Bound; using Bound = Traits::Bound;
typedef CGAL::Arrangement_2<Traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Traits>;
#endif #endif

View File

@ -10,8 +10,8 @@
#include "arr_inexact_construction_segments.h" #include "arr_inexact_construction_segments.h"
#include "point_location_utils.h" #include "point_location_utils.h"
typedef CGAL::Arr_point_location_result<Arrangement> Point_location_result; using Point_location_result = CGAL::Arr_point_location_result<Arrangement>;
typedef std::pair<Point, Point_location_result::Type> Query_result; using Query_result = std::pair<Point, Point_location_result::Type>;
int main() { int main() {
// Construct the arrangement. // Construct the arrangement.

View File

@ -15,12 +15,12 @@
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Arr_face_extended_dcel<Traits, unsigned int> Dcel; using Dcel = CGAL::Arr_face_extended_dcel<Traits, unsigned int>;
typedef CGAL::Arrangement_2<Traits, Dcel> Ex_arrangement; using Ex_arrangement = CGAL::Arrangement_2<Traits, Dcel>;
typedef CGAL::Dual<Ex_arrangement> Dual_arrangement; using Dual_arrangement = CGAL::Dual<Ex_arrangement>;
typedef CGAL::Arr_face_index_map<Ex_arrangement> Face_index_map; using Face_index_map = CGAL::Arr_face_index_map<Ex_arrangement>;
typedef Extended_face_property_map<Ex_arrangement,unsigned int> using Face_property_map =
Face_property_map; Extended_face_property_map<Ex_arrangement,unsigned int>;
int main() { int main() {
// Construct an arrangement of seven intersecting line segments. // Construct an arrangement of seven intersecting line segments.

View File

@ -15,8 +15,8 @@
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
#include "Edge_length.h" #include "Edge_length.h"
typedef CGAL::Arr_vertex_index_map<Arrangement> Vertex_index_map; using Vertex_index_map = CGAL::Arr_vertex_index_map<Arrangement>;
typedef Edge_length<Arrangement> My_edge_length; using My_edge_length = Edge_length<Arrangement>;
int main() { int main() {
// Construct an arrangement of seven intersecting line segments. // Construct an arrangement of seven intersecting line segments.

View File

@ -8,9 +8,9 @@
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
typedef std::pair<CGAL::Object, CGAL::Object> Object_pair; using Object_pair = std::pair<CGAL::Object, CGAL::Object>;
typedef std::pair<Vertex_const_handle, Object_pair> Vert_decomp_entry; using Vert_decomp_entry = std::pair<Vertex_const_handle, Object_pair>;
typedef std::list<Vert_decomp_entry> Vert_decomp_list; using Vert_decomp_list = std::list<Vert_decomp_entry>;
int main() { int main() {
// Construct the arrangement. // Construct the arrangement.

View File

@ -15,23 +15,23 @@
#include <CGAL/Random.h> #include <CGAL/Random.h>
typedef CGAL::Quotient<CGAL::MP_Float> NT; using NT = CGAL::Quotient<CGAL::MP_Float>;
typedef CGAL::Cartesian<NT> Linear_k; using Linear_k = CGAL::Cartesian<NT>;
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT> Algebraic_k; using Algebraic_k = CGAL::Algebraic_kernel_for_circles_2_2<NT>;
typedef CGAL::Circular_kernel_2<Linear_k,Algebraic_k> Circular_k; using Circular_k = CGAL::Circular_kernel_2<Linear_k,Algebraic_k>;
typedef Circular_k::Point_2 Point_2; using Point_2 = Circular_k::Point_2;
typedef Circular_k::Circle_2 Circle_2; using Circle_2 = Circular_k::Circle_2;
typedef Circular_k::Circular_arc_2 Circular_arc_2; using Circular_arc_2 = Circular_k::Circular_arc_2;
typedef Circular_k::Line_arc_2 Line_arc_2; using Line_arc_2 = Circular_k::Line_arc_2;
typedef std::variant< Circular_arc_2, Line_arc_2> Arc_2; using Arc_2 = std::variant< Circular_arc_2, Line_arc_2>;
typedef std::vector< Arc_2> ArcContainer; using ArcContainer = std::vector< Arc_2>;
typedef CGAL::Arr_circular_line_arc_traits_2<Circular_k> Traits; using Traits = CGAL::Arr_circular_line_arc_traits_2<Circular_k>;
typedef CGAL::Arrangement_2<Traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Traits>;
typedef CGAL::Arr_naive_point_location<Arrangement> Point_location; using Point_location = CGAL::Arr_naive_point_location<Arrangement>;
int main() { int main() {
CGAL::Random generatorOfgenerator; CGAL::Random generatorOfgenerator;
@ -46,7 +46,7 @@ int main() {
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
x1 = theRandom.get_int(random_min,random_max); x1 = theRandom.get_int(random_min,random_max);
y1 = 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); x2 = theRandom.get_int(random_min,random_max);
y2 = theRandom.get_int(random_min,random_max); y2 = theRandom.get_int(random_min,random_max);
} while((x1 == x2) && (y1 == y2)); } while((x1 == x2) && (y1 == y2));

View File

@ -11,7 +11,7 @@
#include "arr_conics.h" #include "arr_conics.h"
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Arr_naive_point_location<Arrangement> Naive_pl; using Naive_pl = CGAL::Arr_naive_point_location<Arrangement>;
int main() { int main() {
Traits traits; Traits traits;

View File

@ -9,10 +9,10 @@
enum Segment_color {RED, BLUE}; enum Segment_color {RED, BLUE};
typedef CGAL::Arr_consolidated_curve_data_traits_2<Traits, Segment_color> using Data_traits =
Data_traits; CGAL::Arr_consolidated_curve_data_traits_2<Traits, Segment_color>;
typedef Data_traits::Curve_2 Colored_segment; using Colored_segment = Data_traits::Curve_2;
typedef CGAL::Arrangement_2<Data_traits> Colored_arr; using Colored_arr = CGAL::Arrangement_2<Data_traits>;
int main() { int main() {
Colored_arr arr; Colored_arr arr;

View File

@ -8,9 +8,9 @@
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
#include "point_location_utils.h" #include "point_location_utils.h"
typedef CGAL::Arrangement_with_history_2<Traits> Arr_with_hist; using Arr_with_hist = CGAL::Arrangement_with_history_2<Traits>;
typedef Arr_with_hist::Curve_handle Curve_handle; using Curve_handle = Arr_with_hist::Curve_handle;
typedef CGAL::Arr_trapezoid_ric_point_location<Arr_with_hist> Point_location; using Point_location = CGAL::Arr_trapezoid_ric_point_location<Arr_with_hist>;
int main() { int main() {
// Insert 3 curves incrementally. // Insert 3 curves incrementally.

View File

@ -8,8 +8,8 @@
enum Color {BLUE, RED, WHITE}; enum Color {BLUE, RED, WHITE};
typedef CGAL::Arr_extended_dcel<Traits, Color, bool, size_t> Dcel; using Dcel = CGAL::Arr_extended_dcel<Traits, Color, bool, size_t>;
typedef CGAL::Arrangement_2<Traits, Dcel> Ex_arrangement; using Ex_arrangement = CGAL::Arrangement_2<Traits, Dcel>;
int main() { int main() {
// Construct the arrangement containing two intersecting triangles. // Construct the arrangement containing two intersecting triangles.

View File

@ -31,9 +31,9 @@ std::istream& operator>>(std::istream& is, Color& color) {
return is; return is;
} }
typedef CGAL::Arr_extended_dcel<Traits, Color, bool, int> Ext_dcel; using Ext_dcel = CGAL::Arr_extended_dcel<Traits, Color, bool, int>;
typedef CGAL::Arrangement_2<Traits, Ext_dcel> Ext_arrangement; using Ext_arrangement = CGAL::Arrangement_2<Traits, Ext_dcel>;
typedef CGAL::Arr_extended_dcel_text_formatter<Ext_arrangement> Formatter; using Formatter = CGAL::Arr_extended_dcel_text_formatter<Ext_arrangement>;
int main() { int main() {
// Construct the arrangement containing two intersecting triangles. // Construct the arrangement containing two intersecting triangles.

View File

@ -1,9 +1,9 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
#include <CGAL/Arr_segment_traits_2.h> #include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/draw_arrangement_2.h> #include <CGAL/draw_arrangement_2.h>
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
using Traits = CGAL::Arr_segment_traits_2<Kernel>; using Traits = CGAL::Arr_segment_traits_2<Kernel>;
using Point = Traits::Point_2; using Point = Traits::Point_2;
using Arrangement_2 = CGAL::Arrangement_2<Traits>; using Arrangement_2 = CGAL::Arrangement_2<Traits>;

View File

@ -10,9 +10,9 @@
#include "arr_linear.h" #include "arr_linear.h"
#include "read_objects.h" #include "read_objects.h"
typedef CGAL::Arr_curve_data_traits_2<Traits, size_t> Data_traits; using Data_traits = CGAL::Arr_curve_data_traits_2<Traits, size_t>;
typedef Data_traits::X_monotone_curve_2 Data_x_monotone_curve_2; using Data_x_monotone_curve_2 = Data_traits::X_monotone_curve_2;
typedef CGAL::Arrangement_2<Data_traits> Data_arrangement; using Data_arrangement = CGAL::Arrangement_2<Data_traits>;
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
// Get the name of the input file from the command line, or use the default // Get the name of the input file from the command line, or use the default

View File

@ -8,9 +8,9 @@
#include "arr_circular.h" #include "arr_circular.h"
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Arrangement_with_history_2<Traits> Arr_with_hist; using Arr_with_hist = CGAL::Arrangement_with_history_2<Traits>;
typedef Arr_with_hist::Curve_handle Curve_handle; using Curve_handle = Arr_with_hist::Curve_handle;
typedef CGAL::Arr_walk_along_line_point_location<Arr_with_hist> Point_location; using Point_location = CGAL::Arr_walk_along_line_point_location<Arr_with_hist>;
int main() { int main() {
// Construct an arrangement containing nine circles: C[0] of radius 2 and // Construct an arrangement containing nine circles: C[0] of radius 2 and

View File

@ -7,8 +7,8 @@
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
typedef CGAL::Arr_face_extended_dcel<Traits, size_t> Dcel; using Dcel = CGAL::Arr_face_extended_dcel<Traits, size_t>;
typedef CGAL::Arrangement_2<Traits, Dcel> Ex_arrangement; using Ex_arrangement = CGAL::Arrangement_2<Traits, Dcel>;
// An arrangement observer, used to receive notifications of face splits and // An arrangement observer, used to receive notifications of face splits and
// to update the indices of the newly created faces. // to update the indices of the newly created faces.

View File

@ -9,12 +9,11 @@
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
typedef CGAL::Arr_face_extended_dcel<Traits, bool> Dcel; using Dcel = CGAL::Arr_face_extended_dcel<Traits, bool>;
typedef CGAL::Arrangement_2<Traits, Dcel> Ex_arrangement; using Ex_arrangement = CGAL::Arrangement_2<Traits, Dcel>;
typedef CGAL::Arr_face_overlay_traits<Ex_arrangement, Ex_arrangement, using Overlay_traits =
Ex_arrangement, CGAL::Arr_face_overlay_traits<Ex_arrangement, Ex_arrangement,
std::logical_and<bool> > Ex_arrangement, std::logical_and<bool>>;
Overlay_traits;
int main() { int main() {
// Construct the first arrangement, containing a square-shaped face. // Construct the first arrangement, containing a square-shaped face.

View File

@ -7,18 +7,18 @@
#include "arr_polylines.h" #include "arr_polylines.h"
typedef std::string Name; // The name-field type. using Name = std::string; // The name-field type.
struct Merge_names { struct Merge_names {
Name operator() (const Name& s1, const Name& s2) const Name operator() (const Name& s1, const Name& s2) const
{ return (s1 + " " + s2); } { return (s1 + " " + s2); }
}; };
typedef CGAL::Arr_curve_data_traits_2<Traits, Name, Merge_names> using Ex_traits = CGAL::Arr_curve_data_traits_2<Traits, Name, Merge_names>;
Ex_traits;
typedef Ex_traits::Curve_2 Ex_polyline; using Ex_polyline = Ex_traits::Curve_2;
typedef Ex_traits::X_monotone_curve_2 Ex_x_monotone_polyline; using Ex_x_monotone_polyline = Ex_traits::X_monotone_curve_2;
typedef CGAL::Arrangement_2<Ex_traits> Ex_arrangement; using Ex_arrangement = CGAL::Arrangement_2<Ex_traits>;
int main() { int main() {
// Construct an arrangement of four polylines named A--D. // Construct an arrangement of four polylines named A--D.

View File

@ -7,8 +7,8 @@
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Arr_naive_point_location<Arrangement> Naive_pl; using Naive_pl = CGAL::Arr_naive_point_location<Arrangement>;
typedef CGAL::Arr_point_location_result<Arrangement>::Type Pl_result_type; using Pl_result_type = CGAL::Arr_point_location_result<Arrangement>::Type;
int main() { int main() {
// Construct the arrangement of five intersecting segments. // Construct the arrangement of five intersecting segments.

View File

@ -5,13 +5,13 @@
#if CGAL_USE_GMP && CGAL_USE_MPFI #if CGAL_USE_GMP && CGAL_USE_MPFI
#include <CGAL/Gmpz.h> #include <CGAL/Gmpz.h>
typedef CGAL::Gmpz Integer; using Integer = CGAL::Gmpz;
#elif CGAL_USE_CORE #elif CGAL_USE_CORE
#include <CGAL/CORE_BigInt.h> #include <CGAL/CORE_BigInt.h>
typedef CORE::BigInt Integer; using Integer = CORE::BigInt;
#else #else
#include <CGAL/leda_integer.h> #include <CGAL/leda_integer.h>
typedef LEDA::integer Integer; using Integer = LEDA::integer;
#endif #endif
#endif #endif

View File

@ -10,7 +10,7 @@
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Arrangement_with_history_2<Traits> Arr_with_hist; using Arr_with_hist = CGAL::Arrangement_with_history_2<Traits>;
int main() { int main() {
// Insert six additional segments aggregately: // Insert six additional segments aggregately:

View File

@ -11,9 +11,9 @@
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
#include "Overlay_color_traits.h" #include "Overlay_color_traits.h"
typedef unsigned int Color; using Color = unsigned int;
typedef CGAL::Arr_extended_dcel<Traits, Color, Color, Color> Dcel; using Dcel = CGAL::Arr_extended_dcel<Traits, Color, Color, Color>;
typedef CGAL::Arrangement_2<Traits, Dcel> Ex_arrangement; using Ex_arrangement = CGAL::Arrangement_2<Traits, Dcel>;
int main() { int main() {
const Color vcol1(0x00000080), hcol1(0x000000ff), fcol1(0x00ccccff); const Color vcol1(0x00000080), hcol1(0x000000ff), fcol1(0x00ccccff);

View File

@ -16,15 +16,15 @@ struct Overlay_label {
{ return c + std::to_string(i); } { return c + std::to_string(i); }
}; };
typedef CGAL::Arr_face_extended_dcel<Traits, char> Dcel_dlue; using Dcel_dlue = CGAL::Arr_face_extended_dcel<Traits, char>;
typedef CGAL::Arrangement_2<Traits, Dcel_dlue> Arrangement_blue; using Arrangement_blue = CGAL::Arrangement_2<Traits, Dcel_dlue>;
typedef CGAL::Arr_face_extended_dcel<Traits, unsigned int> Dcel_red; using Dcel_red = CGAL::Arr_face_extended_dcel<Traits, unsigned int>;
typedef CGAL::Arrangement_2<Traits, Dcel_red> Arrangement_red; using Arrangement_red = CGAL::Arrangement_2<Traits, Dcel_red>;
typedef CGAL::Arr_face_extended_dcel<Traits, std::string> Dcel_res; using Dcel_res = CGAL::Arr_face_extended_dcel<Traits, std::string>;
typedef CGAL::Arrangement_2<Traits, Dcel_res> Arrangement_res; using Arrangement_res = CGAL::Arrangement_2<Traits, Dcel_res>;
typedef CGAL::Arr_face_overlay_traits<Arrangement_blue, Arrangement_red, using Overlay_traits =
Arrangement_res, Overlay_label> CGAL::Arr_face_overlay_traits<Arrangement_blue, Arrangement_red,
Overlay_traits; Arrangement_res, Overlay_label>;
int main() { int main() {
// Construct the first arrangement, induced by two lines y = x and y = -x. // Construct the first arrangement, induced by two lines y = x and y = -x.

View File

@ -8,8 +8,8 @@
#include "arr_inexact_construction_segments.h" #include "arr_inexact_construction_segments.h"
#include "point_location_utils.h" #include "point_location_utils.h"
typedef CGAL::Arr_naive_point_location<Arrangement> Naive_pl; using Naive_pl = CGAL::Arr_naive_point_location<Arrangement>;
typedef CGAL::Arr_landmarks_point_location<Arrangement> Landmarks_pl; using Landmarks_pl = CGAL::Arr_landmarks_point_location<Arrangement>;
int main() { int main() {
// Construct the arrangement. // Construct the arrangement.

View File

@ -9,10 +9,10 @@ void print_point_location
(const typename Arrangement_::Point_2& q, (const typename Arrangement_::Point_2& q,
typename CGAL::Arr_point_location_result<Arrangement_>::Type obj) typename CGAL::Arr_point_location_result<Arrangement_>::Type obj)
{ {
typedef Arrangement_ Arrangement_2; using Arrangement_2 = Arrangement_;
typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; using Vertex_const_handle = typename Arrangement_2::Vertex_const_handle;
typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; using Halfedge_const_handle = typename Arrangement_2::Halfedge_const_handle;
typedef typename Arrangement_2::Face_const_handle Face_const_handle; using Face_const_handle = typename Arrangement_2::Face_const_handle;
const Vertex_const_handle* v; const Vertex_const_handle* v;
const Halfedge_const_handle* e; const Halfedge_const_handle* e;
@ -39,8 +39,8 @@ void locate_point(const PointLocation& pl,
const typename PointLocation::Arrangement_2::Point_2& q) const typename PointLocation::Arrangement_2::Point_2& q)
{ {
// Perform the point-location query. // Perform the point-location query.
typedef PointLocation Point_location; using Point_location = PointLocation;
typedef typename Point_location::Arrangement_2 Arrangement_2; using Arrangement_2 = typename Point_location::Arrangement_2;
typename CGAL::Arr_point_location_result<Arrangement_2>::Type obj = typename CGAL::Arr_point_location_result<Arrangement_2>::Type obj =
pl.locate(q); pl.locate(q);
@ -56,16 +56,16 @@ void shoot_vertical_ray(const VerticalRayShooting& vrs,
const typename const typename
VerticalRayShooting::Arrangement_2::Point_2& q) VerticalRayShooting::Arrangement_2::Point_2& q)
{ {
typedef VerticalRayShooting Vertical_ray_shooting; using Vertical_ray_shooting = VerticalRayShooting;
// Perform the point-location query. // Perform the point-location query.
typename Vertical_ray_shooting::result_type obj = vrs.ray_shoot_up(q); typename Vertical_ray_shooting::result_type obj = vrs.ray_shoot_up(q);
// Print the result. // Print the result.
typedef typename Vertical_ray_shooting::Arrangement_2 Arrangement_2; using Arrangement_2 = typename Vertical_ray_shooting::Arrangement_2;
typedef typename Arrangement_2::Vertex_const_handle Vertex_const_handle; using Vertex_const_handle = typename Arrangement_2::Vertex_const_handle;
typedef typename Arrangement_2::Halfedge_const_handle Halfedge_const_handle; using Halfedge_const_handle = typename Arrangement_2::Halfedge_const_handle;
typedef typename Arrangement_2::Face_const_handle Face_const_handle; using Face_const_handle = typename Arrangement_2::Face_const_handle;
const Vertex_const_handle* v; const Vertex_const_handle* v;
const Halfedge_const_handle* e; const Halfedge_const_handle* e;
@ -94,10 +94,10 @@ void shoot_vertical_ray(const VerticalRayShooting& vrs,
template <typename Arrangement_> template <typename Arrangement_>
void construct_segments_arr(Arrangement_& arr) void construct_segments_arr(Arrangement_& arr)
{ {
typedef Arrangement_ Arrangement_2; using Arrangement_2 = Arrangement_;
typedef typename Arrangement_2::Point_2 Point_2; using Point_2 = typename Arrangement_2::Point_2;
typedef typename Arrangement_2::X_monotone_curve_2 Segment_2; using Segment_2 = typename Arrangement_2::X_monotone_curve_2;
typedef typename Arrangement_2::Halfedge_handle Halfedge_handle; 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); 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); Segment_2 s1(p1, p2), s2(p2, p3), s3(p3, p4), s4(p4, p5), s5(p5, p1);

View File

@ -19,12 +19,12 @@ int main() {
#include "arr_Bezier.h" #include "arr_Bezier.h"
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Arr_polycurve_traits_2<Traits> Polycurve_bezier_traits; using Polycurve_bezier_traits = CGAL::Arr_polycurve_traits_2<Traits>;
typedef Polycurve_bezier_traits::Point_2 Point; using Point = Polycurve_bezier_traits::Point_2;
typedef Polycurve_bezier_traits::X_monotone_curve_2 X_mono_polycurve; using X_mono_polycurve = Polycurve_bezier_traits::X_monotone_curve_2;
typedef CGAL::Arrangement_2<Polycurve_bezier_traits> Arrangement_2; using Arrangement_2 = CGAL::Arrangement_2<Polycurve_bezier_traits>;
typedef std::variant<Point, Bezier_x_monotone_curve> Make_x_monotone_result; using Make_x_monotone_result = std::variant<Point, Bezier_x_monotone_curve>;
int main() { int main() {
Polycurve_bezier_traits pc_traits; Polycurve_bezier_traits pc_traits;

View File

@ -22,11 +22,11 @@ int main() {
#include "arr_circular.h" #include "arr_circular.h"
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Arr_polycurve_traits_2<Traits> Polycurve_traits; using Polycurve_traits = CGAL::Arr_polycurve_traits_2<Traits>;
typedef Polycurve_traits::X_monotone_curve_2 X_monotone_polycurve; using X_monotone_polycurve = Polycurve_traits::X_monotone_curve_2;
typedef Polycurve_traits::Curve_2 Polycurve; using Polycurve = Polycurve_traits::Curve_2;
typedef Kernel::Circle_2 Circle_2; using Circle_2 = Kernel::Circle_2;
typedef CGAL::Arrangement_2<Polycurve_traits> Polycurve_circ_arc_arrangment; using Polycurve_circ_arc_arrangment = CGAL::Arrangement_2<Polycurve_traits>;
int main() { int main() {
Polycurve_traits traits; Polycurve_traits traits;

View File

@ -21,10 +21,10 @@ int main() {
#include "arr_conics.h" #include "arr_conics.h"
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Arr_polycurve_traits_2<Traits> Polycurve_conic_traits_2; using Polycurve_conic_traits_2 = CGAL::Arr_polycurve_traits_2<Traits>;
typedef Polycurve_conic_traits_2::X_monotone_curve_2 X_monotone_polycurve; using X_monotone_polycurve = Polycurve_conic_traits_2::X_monotone_curve_2;
typedef Polycurve_conic_traits_2::Curve_2 Polycurve; using Polycurve = Polycurve_conic_traits_2::Curve_2;
typedef CGAL::Arrangement_2<Polycurve_conic_traits_2> Polycurve_conic_arrangment; using Polycurve_conic_arrangment = CGAL::Arrangement_2<Polycurve_conic_traits_2>;
int main() { int main() {
Traits sub_traits; Traits sub_traits;

View File

@ -10,31 +10,29 @@
#include <CGAL/Arr_polyline_traits_2.h> #include <CGAL/Arr_polyline_traits_2.h>
#include <CGAL/Arrangement_on_surface_2.h> #include <CGAL/Arrangement_on_surface_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel> Segment_traits_2; using Segment_traits_2 = CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel>;
typedef CGAL::Arr_polyline_traits_2<Segment_traits_2> Poly_traits_2; using Poly_traits_2 = CGAL::Arr_polyline_traits_2<Segment_traits_2>;
typedef Poly_traits_2::Point_2 Point_2; using Point_2 = Poly_traits_2::Point_2;
typedef Poly_traits_2::Curve_2 Poly_curve_2; using Poly_curve_2 = Poly_traits_2::Curve_2;
typedef Poly_traits_2::X_monotone_curve_2 X_poly_curve_2; using X_poly_curve_2 = Poly_traits_2::X_monotone_curve_2;
typedef CGAL::Arr_spherical_topology_traits_2<Poly_traits_2> using Topol_poly_traits_2 =
Topol_poly_traits_2; CGAL::Arr_spherical_topology_traits_2<Poly_traits_2>;
typedef CGAL::Arrangement_on_surface_2<Poly_traits_2, Topol_poly_traits_2> using Poly_arr =
Poly_arr; CGAL::Arrangement_on_surface_2<Poly_traits_2, Topol_poly_traits_2>;
typedef Segment_traits_2::Curve_2 Seg_curve_2; using Seg_curve_2 = Segment_traits_2::Curve_2;
typedef Segment_traits_2::X_monotone_curve_2 X_seg_curve_2; using X_seg_curve_2 = Segment_traits_2::X_monotone_curve_2;
typedef CGAL::Arr_spherical_topology_traits_2<Segment_traits_2> using Topol_segment_traits_2 =
Topol_segment_traits_2; CGAL::Arr_spherical_topology_traits_2<Segment_traits_2>;
typedef CGAL::Arrangement_on_surface_2<Segment_traits_2, Topol_segment_traits_2> using Segment_arr =
Segment_arr; CGAL::Arrangement_on_surface_2<Segment_traits_2, Topol_segment_traits_2>;
int main() { int main() {
Segment_traits_2 seg_traits; Segment_traits_2 seg_traits;
Segment_traits_2::Construct_point_2 ctr_p = auto ctr_p = seg_traits.construct_point_2_object();
seg_traits.construct_point_2_object(); auto ctr_seg = seg_traits.construct_x_monotone_curve_2_object();
Segment_traits_2::Construct_x_monotone_curve_2 ctr_seg =
seg_traits.construct_x_monotone_curve_2_object();
Point_2 p1 = ctr_p(0, 1, -1); Point_2 p1 = ctr_p(0, 1, -1);
Point_2 p2 = ctr_p(-11, 7, -7); Point_2 p2 = ctr_p(-11, 7, -7);
@ -62,8 +60,7 @@ int main() {
points.push_back(p5); points.push_back(p5);
Poly_traits_2 poly_traits; Poly_traits_2 poly_traits;
Poly_traits_2::Construct_x_monotone_curve_2 ctr = auto ctr = poly_traits.construct_x_monotone_curve_2_object();
poly_traits.construct_x_monotone_curve_2_object();
Poly_arr poly_arr(&poly_traits); Poly_arr poly_arr(&poly_traits);
insert(poly_arr, ctr(seg_cv1)); insert(poly_arr, ctr(seg_cv1));
insert(poly_arr, ctr(seg_cv2)); insert(poly_arr, ctr(seg_cv2));

View File

@ -10,14 +10,14 @@
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
typedef CGAL::Arr_directional_non_caching_segment_basic_traits_2<Kernel> using Subcurve_traits =
Subcurve_traits; CGAL::Arr_directional_non_caching_segment_basic_traits_2<Kernel>;
typedef CGAL::Arr_polycurve_basic_traits_2<Subcurve_traits> Geom_traits; using Geom_traits = CGAL::Arr_polycurve_basic_traits_2<Subcurve_traits>;
typedef Geom_traits::Point_2 Point; using Point = Geom_traits::Point_2;
typedef Subcurve_traits::X_monotone_curve_2 X_monotone_subcurve; using X_monotone_subcurve = Subcurve_traits::X_monotone_curve_2;
typedef Geom_traits::X_monotone_curve_2 X_monotone_curve; using X_monotone_curve = Geom_traits::X_monotone_curve_2;
typedef CGAL::Arrangement_2<Geom_traits> Arrangement; using Arrangement = CGAL::Arrangement_2<Geom_traits>;
int main() { int main() {
Geom_traits traits; Geom_traits traits;

View File

@ -3,9 +3,9 @@
// predefined kernel with exact constructions and exact predicates. // predefined kernel with exact constructions and exact predicates.
#include <list> #include <list>
#include <chrono>
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Timer.h>
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
#include "arr_print.h" #include "arr_print.h"
@ -28,18 +28,17 @@ int main (int argc, char* argv[]) {
// Construct the arrangement by aggregately inserting all segments. // Construct the arrangement by aggregately inserting all segments.
Arrangement arr; Arrangement arr;
CGAL::Timer timer;
std::cout << "Performing aggregated insertion of " std::cout << "Performing aggregated insertion of "
<< segments.size() << " segments.\n"; << segments.size() << " segments.\n";
timer.start(); auto start = std::chrono::system_clock::now();
insert(arr, segments.begin(), segments.end()); insert(arr, segments.begin(), segments.end());
timer.stop(); std::chrono::duration<double> secs = std::chrono::system_clock::now() - start;
print_arrangement_size(arr); print_arrangement_size(arr);
std::cout << "Construction took " << timer.time() << " seconds.\n"; std::cout << "Construction took " << secs.count() << " seconds.\n";
return 0; return 0;
} }

View File

@ -2,19 +2,20 @@
// Constructing an arrangement of non-intersecting line segments using the // Constructing an arrangement of non-intersecting line segments using the
// predefined kernel with exact predicates. // predefined kernel with exact predicates.
#include <list>
#include <fstream>
#include <chrono>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Arr_non_caching_segment_basic_traits_2.h> #include <CGAL/Arr_non_caching_segment_basic_traits_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
#include <CGAL/Timer.h>
#include <list>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
typedef Kernel::FT Number_type; using Number_type = Kernel::FT;
typedef CGAL::Arr_non_caching_segment_basic_traits_2<Kernel> Traits_2; using Traits_2 = CGAL::Arr_non_caching_segment_basic_traits_2<Kernel>;
typedef Traits_2::Point_2 Point_2; using Point_2 = Traits_2::Point_2;
typedef Traits_2::X_monotone_curve_2 Segment_2; using Segment_2 = Traits_2::X_monotone_curve_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2; using Arrangement_2 = CGAL::Arrangement_2<Traits_2>;
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
// Get the name of the input file from the command line, or use the default // 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[]) {
// <sx_n> <sy_n> <tx_n> <ty_n> // source and target of segment #n. // <sx_n> <sy_n> <tx_n> <ty_n> // source and target of segment #n.
std::list<Segment_2> segments; std::list<Segment_2> segments;
unsigned int n; std::size_t n;
in_file >> n; in_file >> n;
unsigned int i; for (std::size_t i = 0; i < n; ++i) {
for (i = 0; i < n; ++i) {
double sx, sy, tx, ty; double sx, sy, tx, ty;
in_file >> sx >> sy >> tx >> ty; in_file >> sx >> sy >> tx >> ty;
segments.push_back (Segment_2 (Point_2 (Number_type(sx), Number_type(sy)), segments.push_back(Segment_2(Point_2 (Number_type(sx), Number_type(sy)),
Point_2 (Number_type(tx), Number_type(ty)))); Point_2 (Number_type(tx), Number_type(ty))));
} }
in_file.close(); in_file.close();
// Construct the arrangement by aggregately inserting all segments. // Construct the arrangement by aggregately inserting all segments.
Arrangement_2 arr; Arrangement_2 arr;
CGAL::Timer timer;
std::cout << "Performing aggregated insertion of " << n << " segments.\n"; 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()); insert_non_intersecting_curves (arr, segments.begin(), segments.end());
timer.stop(); std::chrono::duration<double> secs = std::chrono::system_clock::now() - start;
// Print the arrangement dimensions. // Print the arrangement dimensions.
std::cout << "V = " << arr.number_of_vertices() std::cout << "V = " << arr.number_of_vertices()
<< ", E = " << arr.number_of_edges() << ", E = " << arr.number_of_edges()
<< ", F = " << arr.number_of_faces() << std::endl; << ", 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; return 0;
} }

View File

@ -18,23 +18,22 @@ int main() {
#include <CGAL/Arr_rational_function_traits_2.h> // Traits #include <CGAL/Arr_rational_function_traits_2.h> // Traits
#include <CGAL/Arrangement_2.h> // Arrangement #include <CGAL/Arrangement_2.h> // Arrangement
typedef CORE::BigInt Integer; using Integer = CORE::BigInt;
typedef CORE::BigRat Rational; using Rational = CORE::BigRat;
typedef CGAL::Algebraic_kernel_d_1<Integer> AK1; using AK1 = CGAL::Algebraic_kernel_d_1<Integer>;
typedef CGAL::Arr_rational_function_traits_2<AK1> Traits_2; using Traits_2 = CGAL::Arr_rational_function_traits_2<AK1>;
typedef std::vector<Rational> Rat_vec; using Rat_vec = std::vector<Rational>;
typedef Traits_2::Algebraic_real_1 Alg_real_1; using Alg_real_1 = Traits_2::Algebraic_real_1;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2; using Arrangement_2 = CGAL::Arrangement_2<Traits_2>;
int main () { int main () {
CGAL::IO::set_pretty_mode(std::cout); // for nice printouts. CGAL::IO::set_pretty_mode(std::cout); // for nice printouts.
// Traits class object // Traits class object
Traits_2 traits; Traits_2 traits;
Traits_2::Construct_x_monotone_curve_2 construct_arc auto construct_arc = traits.construct_x_monotone_curve_2_object();
= traits.construct_x_monotone_curve_2_object();
// container storing all arcs // container storing all arcs
std::vector<Traits_2::X_monotone_curve_2> arcs; std::vector<Traits_2::X_monotone_curve_2> arcs;

View File

@ -14,36 +14,36 @@
#include "point_location_utils.h" #include "point_location_utils.h"
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
typedef Kernel::Point_3 Point_3; using Point_3 = Kernel::Point_3;
typedef Kernel::Direction_3 Direction_3; using Direction_3 = Kernel::Direction_3;
#if 0 #if 0
typedef CGAL::Arr_polyhedral_sgm_traits<Kernel, -8, 6> Gm_traits; using Gm_traits = CGAL::Arr_polyhedral_sgm_traits<Kernel, -8, 6>;
#elif 0 #elif 0
typedef CGAL::Arr_polyhedral_sgm_traits<Kernel, -11, 7> Gm_traits; using Gm_traits = CGAL::Arr_polyhedral_sgm_traits<Kernel, -11, 7>;
#else #else
typedef CGAL::Arr_polyhedral_sgm_traits<Kernel, -1, 0> Gm_traits; using Gm_traits = CGAL::Arr_polyhedral_sgm_traits<Kernel, -1, 0>;
#endif #endif
typedef CGAL::Arr_polyhedral_sgm<Gm_traits> Gm; using Gm = CGAL::Arr_polyhedral_sgm<Gm_traits>;
typedef CGAL::Arr_polyhedral_sgm_polyhedron_3<Gm, Kernel> Gm_polyhedron; using Gm_polyhedron = CGAL::Arr_polyhedral_sgm_polyhedron_3<Gm, Kernel>;
typedef CGAL::Arr_polyhedral_sgm_initializer<Gm, Gm_polyhedron> Gm_initializer; using Gm_initializer = CGAL::Arr_polyhedral_sgm_initializer<Gm, Gm_polyhedron>;
typedef CGAL::Arr_naive_point_location<Gm> Naive_pl; using Naive_pl = CGAL::Arr_naive_point_location<Gm>;
typedef CGAL::Arr_walk_along_line_point_location<Gm> Walk_pl; using Walk_pl = CGAL::Arr_walk_along_line_point_location<Gm>;
typedef CGAL::Arr_landmarks_point_location<Gm> Landmarks_pl; using Landmarks_pl = CGAL::Arr_landmarks_point_location<Gm>;
typedef CGAL::Arr_trapezoid_ric_point_location<Gm> Trap_pl; using Trap_pl = CGAL::Arr_trapezoid_ric_point_location<Gm>;
typedef Gm::Geometry_traits_2 Geom_traits; using Geom_traits = Gm::Geometry_traits_2;
typedef Geom_traits::Point_2 Point_2; using Point_2 = Geom_traits::Point_2;
typedef CGAL::Arr_point_location_result<Gm> Point_location_result; using Point_location_result = CGAL::Arr_point_location_result<Gm>;
typedef std::pair<Point_2, Point_location_result::Type> Query_result; using Query_result = std::pair<Point_2, Point_location_result::Type>;
typedef Gm::Vertex_const_handle Vertex_const_handle; using Vertex_const_handle = Gm::Vertex_const_handle;
typedef Gm::Halfedge_const_handle Halfedge_const_handle; using Halfedge_const_handle = Gm::Halfedge_const_handle;
typedef Gm::Face_const_handle Face_const_handle; using Face_const_handle = Gm::Face_const_handle;
int main() { int main() {
Gm_polyhedron p; Gm_polyhedron p;
@ -77,7 +77,7 @@ protected:
gm_initializer(p); gm_initializer(p);
if (! gm.is_valid()) return -1; 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[] = { Point_2 points[] = {
ctr_point(-1, 0, 0), ctr_point(-1, 0, 0),
ctr_point(0, -1, 0), ctr_point(0, -1, 0),

View File

@ -15,31 +15,30 @@
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
#if 0 #if 0
typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel, -8, 6> Geom_traits_2; using Geom_traits_2 = CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel, -8, 6>;
#elif 0 #elif 0
typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel, -11, 7> Geom_traits_2; using Geom_traits_2 = CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel, -11, 7>;
#else #else
typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel, -1, 0> Geom_traits_2; using Geom_traits_2 = CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel, -1, 0>;
#endif #endif
typedef Geom_traits_2::Point_2 Point_2; using Point_2 = Geom_traits_2::Point_2;
typedef Geom_traits_2::X_monotone_curve_2 X_monotone_curve_2; using X_monotone_curve_2 = Geom_traits_2::X_monotone_curve_2;
typedef CGAL::Arr_spherical_topology_traits_2<Geom_traits_2> Topol_traits_2; using Topol_traits_2 = CGAL::Arr_spherical_topology_traits_2<Geom_traits_2>;
typedef CGAL::Arrangement_on_surface_2<Geom_traits_2, Topol_traits_2> using Arrangement_2 =
Arrangement_2; CGAL::Arrangement_on_surface_2<Geom_traits_2, Topol_traits_2>;
typedef Arrangement_2::Vertex_handle Vertex_handle; using Vertex_handle = Arrangement_2::Vertex_handle;
int main() { int main() {
Geom_traits_2 traits; Geom_traits_2 traits;
Geom_traits_2::Construct_point_2 ctr_p = traits.construct_point_2_object(); auto ctr_p = traits.construct_point_2_object();
Geom_traits_2::Construct_x_monotone_curve_2 ctr_xcv = auto ctr_xcv = traits.construct_x_monotone_curve_2_object();
traits.construct_x_monotone_curve_2_object();
std::vector< Point_2 > points; std::vector<Point_2> points;
std::vector< X_monotone_curve_2 > xcvs; std::vector<X_monotone_curve_2> xcvs;
CGAL::IO::set_pretty_mode(std::cout); CGAL::IO::set_pretty_mode(std::cout);

View File

@ -10,12 +10,12 @@
#include "arr_print.h" #include "arr_print.h"
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel> Geom_traits; using Geom_traits = CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel>;
typedef Geom_traits::Point_2 Point; using Point = Geom_traits::Point_2;
typedef Geom_traits::Curve_2 Curve; using Curve = Geom_traits::Curve_2;
typedef CGAL::Arr_spherical_topology_traits_2<Geom_traits> Topol_traits; using Topol_traits = CGAL::Arr_spherical_topology_traits_2<Geom_traits>;
typedef CGAL::Arrangement_on_surface_2<Geom_traits, Topol_traits> Arrangement; using Arrangement = CGAL::Arrangement_on_surface_2<Geom_traits, Topol_traits>;
int main() { int main() {
// Construct the arrangement from 12 geodesic arcs. // Construct the arrangement from 12 geodesic arcs.
@ -46,7 +46,6 @@ int main() {
CGAL::insert(arr, arcs.begin(), arcs.end()); CGAL::insert(arr, arcs.begin(), arcs.end());
print_arrangement_size(arr); // print the arrangement size print_arrangement_size(arr); // print the arrangement size
// print_arrangement(arr);
return 0; return 0;
} }

View File

@ -7,7 +7,7 @@
#include "arr_geodesic_on_sphere.h" #include "arr_geodesic_on_sphere.h"
typedef CGAL::Arr_default_overlay_traits<Arrangement> Overlay_traits; using Overlay_traits = CGAL::Arr_default_overlay_traits<Arrangement>;
int main() { int main() {
Geom_traits traits; Geom_traits traits;

View File

@ -9,9 +9,9 @@
#include "arr_exact_construction_segments.h" #include "arr_exact_construction_segments.h"
typedef CGAL::Arr_tracing_traits_2<Traits> Tracing_traits; using Tracing_traits = CGAL::Arr_tracing_traits_2<Traits>;
typedef CGAL::Arr_counting_traits_2<Tracing_traits> Geom_traits; using Geom_traits = CGAL::Arr_counting_traits_2<Tracing_traits>;
typedef CGAL::Arrangement_2<Geom_traits> My_arrangement; using My_arrangement = CGAL::Arrangement_2<Geom_traits>;
int main() { int main() {
const Segment s1(Point(0, 0), Point(2, 2)); const Segment s1(Point(0, 0), Point(2, 2));

View File

@ -8,12 +8,12 @@
#include "arr_linear.h" #include "arr_linear.h"
typedef std::variant<Vertex_const_handle, Halfedge_const_handle, using Cell_type = std::variant<Vertex_const_handle, Halfedge_const_handle,
Face_const_handle> Cell_type; Face_const_handle>;
typedef std::optional<Cell_type> Vert_decomp_type; using Vert_decomp_type = std::optional<Cell_type>;
typedef std::pair<Vert_decomp_type, Vert_decomp_type> Vert_decomp_pair; using Vert_decomp_pair = std::pair<Vert_decomp_type, Vert_decomp_type>;
typedef std::pair<Vertex_const_handle, Vert_decomp_pair> Vert_decomp_entry; using Vert_decomp_entry = std::pair<Vertex_const_handle, Vert_decomp_pair>;
typedef std::list<Vert_decomp_entry> Vert_decomp_list; using Vert_decomp_list = std::list<Vert_decomp_entry>;
int main() { int main() {
// Construct the arrangement. // Construct the arrangement.

View File

@ -8,8 +8,8 @@
#include "arr_inexact_construction_segments.h" #include "arr_inexact_construction_segments.h"
#include "point_location_utils.h" #include "point_location_utils.h"
typedef CGAL::Arr_walk_along_line_point_location<Arrangement> Walk_pl; using Walk_pl = CGAL::Arr_walk_along_line_point_location<Arrangement>;
typedef CGAL::Arr_trapezoid_ric_point_location<Arrangement> Trap_pl; using Trap_pl = CGAL::Arr_trapezoid_ric_point_location<Arrangement>;
int main() { int main() {
// Construct the arrangement. // Construct the arrangement.

View File

@ -141,15 +141,15 @@ public:
/*! Obtain the rational kernel. /*! 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. /*! 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. /*! 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. */ /*! Obtain the next conic index. */
static size_t get_index() { static size_t get_index() {
@ -2258,7 +2258,7 @@ public:
*/ */
Curve_2 operator()(const Rational& r, const Rational& s, const Rational& t, Curve_2 operator()(const Rational& r, const Rational& s, const Rational& t,
const Rational& u, const Rational& v, const Rational& w, const Rational& u, const Rational& v, const Rational& w,
const Orientation& orient, Orientation orient,
const Point_2& source, const Point_2& target) const { const Point_2& source, const Point_2& target) const {
// Make sure that the source and the taget are not the same. // Make sure that the source and the taget are not the same.
const auto alg_kernel = m_traits.m_alg_kernel; const auto alg_kernel = m_traits.m_alg_kernel;
@ -2280,7 +2280,7 @@ public:
* \pre The three points must not be collinear. * \pre The three points must not be collinear.
*/ */
Curve_2 operator()(const Rat_point_2& p1, const Rat_point_2& p2, 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; Curve_2 arc;
// Set the source and target. // Set the source and target.
@ -2363,7 +2363,7 @@ public:
*/ */
Curve_2 operator()(const Rat_point_2& p1, const Rat_point_2& p2, 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& p3, const Rat_point_2& p4,
const Rat_point_2& p5) { const Rat_point_2& p5) const {
Curve_2 arc; Curve_2 arc;
// Make sure that no three points are collinear. // Make sure that no three points are collinear.
@ -2457,7 +2457,7 @@ public:
*/ */
Curve_2 operator()(const Rational& r, const Rational& s, const Rational& t, Curve_2 operator()(const Rational& r, const Rational& s, const Rational& t,
const Rational& u, const Rational& v, const Rational& w, const Rational& u, const Rational& v, const Rational& w,
const Orientation& orient, Orientation orient,
const Point_2& app_source, const Point_2& app_source,
const Rational& r_1, const Rational& s_1, const Rational& r_1, const Rational& s_1,
const Rational& t_1, const Rational& u_1, const Rational& t_1, const Rational& u_1,
@ -2724,9 +2724,8 @@ public:
* \pre The source and the target must be on the conic boundary and must * \pre The source and the target must be on the conic boundary and must
* not be the same. * 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 { const Point_2& source, const Point_2& target) const {
// Make sure that the source and the taget are not the same. // Make sure that the source and the taget are not the same.
CGAL_precondition_code(auto cmp_xy = CGAL_precondition_code(auto cmp_xy =
m_traits.m_alg_kernel->compare_xy_2_object()); m_traits.m_alg_kernel->compare_xy_2_object());

View File

@ -247,27 +247,32 @@ public:
private: private:
const Base_traits_2& m_base; const Base_traits_2& m_base;
/*! Generate a helper class template to find out whether the base geometry template <typename T>
* traits has a nested type named Are_mergeable_2. bool are_mergeable_data(const T& /* cv1 */, const T& /* cv2 */, long) const {
*/ CGAL_error_msg("Equality operator is not supported.");
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_are_mergeable_2, return false;
Are_mergeable_2, false) }
template <typename T>
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 /*! Implementation of the predicate in case the base geometry traits class
* has a nested type named Are_mergeable_2. * has a nested type named Are_mergeable_2.
*/ */
template <typename GeomeTraits_2> template <typename GeomeTraits_2>
std::enable_if_t<has_are_mergeable_2<GeomeTraits_2>::value,bool> auto are_mergeable(const X_monotone_curve_2& cv1,
are_mergeable(const X_monotone_curve_2& cv1, const X_monotone_curve_2& cv2,
const X_monotone_curve_2& cv2) const 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 // In case the two base curves are not mergeable, the extended curves
// are not mergeable as well. // 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 // In case the two base curves are mergeable, check that they have the
// same data fields. // 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 /*! Implementation of the predicate in case the base geometry traits class
@ -275,10 +280,9 @@ public:
* This function should never be called! * This function should never be called!
*/ */
template <typename GeomeTraits_2> template <typename GeomeTraits_2>
std::enable_if_t<!has_are_mergeable_2<GeomeTraits_2>::value,bool> bool are_mergeable(const X_monotone_curve_2& /* cv1 */,
are_mergeable(const X_monotone_curve_2& /* cv1 */, const X_monotone_curve_2& /* cv2 */,
const X_monotone_curve_2& /* cv2 */) const const GeomeTraits_2& /* traits */, long) const {
{
CGAL_error_msg("Are mergeable is not supported."); CGAL_error_msg("Are mergeable is not supported.");
return false; return false;
} }
@ -294,7 +298,7 @@ public:
*/ */
bool operator()(const X_monotone_curve_2& cv1, bool operator()(const X_monotone_curve_2& cv1,
const X_monotone_curve_2& cv2) const const X_monotone_curve_2& cv2) const
{ return are_mergeable<Base_traits_2>(cv1, cv2); } { return are_mergeable<Base_traits_2>(cv1, cv2, m_base, 0); }
}; };
/*! Obtain an Are_mergeable_2 functor object. */ /*! Obtain an Are_mergeable_2 functor object. */

View File

@ -19,30 +19,61 @@
#include <iostream> #include <iostream>
#include <list> #include <list>
#include <algorithm>
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/General_polygon_set_2.h> #include <CGAL/General_polygon_set_2.h>
namespace CGAL { namespace CGAL {
template <typename Traits> /*! Inserter operator for general polygons sets.
std::ostream & operator<< (std::ostream& os, * Inserts a general polygon set into an output stream.
const CGAL::General_polygon_set_2<Traits> & pgn_set) * \param os the output stream.
{ * \param pgn_set the general polygon set.
typedef typename CGAL::General_polygon_set_2<Traits>::Polygon_with_holes_2 * \return the output stream.
Polygon_with_holes_2; */
typedef std::list<Polygon_with_holes_2> Pgn_with_holes_container; template <typename GeomTraits_, typename Dcel_>
std::ostream&
Pgn_with_holes_container res; operator<<(std::ostream& os,
pgn_set.polygons_with_holes (std::back_inserter (res)); const CGAL::General_polygon_set_2<GeomTraits_, Dcel_>& pgn_set) {
using Geometry_traits_2 = GeomTraits_;
using Dcel = Dcel_;
using Gps = CGAL::General_polygon_set_2<Geometry_traits_2, Dcel>;
using Pwh_2 = typename Gps::Polygon_with_holes_2;
using Pgn_with_holes_container = std::list<Pwh_2>;
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::cout << pgn_set.number_of_polygons_with_holes() << std::endl;
std::copy(res.begin(), res.end(), std::copy(pwhs.begin(), pwhs.end(), std::ostream_iterator<Pwh_2>(os, "\n"));
std::ostream_iterator<Polygon_with_holes_2>(std::cout, "\n"));
return os; 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 <typename GeomTraits_, typename Dcel_>
std::istream&
operator>>(std::istream& is,
CGAL::General_polygon_set_2<GeomTraits_, Dcel_>& pgn_set) {
using Geometry_traits_2 = GeomTraits_;
using Dcel = Dcel_;
using Gps = CGAL::General_polygon_set_2<Geometry_traits_2, Dcel>;
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 } //namespace CGAL
#include <CGAL/enable_warnings.h> #include <CGAL/enable_warnings.h>

View File

@ -24,7 +24,6 @@
#include <list> #include <list>
#include <vector> #include <vector>
#include <CGAL/Object.h>
#include <CGAL/No_intersection_surface_sweep_2.h> #include <CGAL/No_intersection_surface_sweep_2.h>
#include <CGAL/Surface_sweep_2/Random_access_output_iterator.h> #include <CGAL/Surface_sweep_2/Random_access_output_iterator.h>
#include <CGAL/algorithm.h> #include <CGAL/algorithm.h>

View File

@ -84,7 +84,7 @@ public:
/*! Destructor */ /*! Destructor */
virtual ~Default_visitor_base() {} 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; } void attach(Surface_sweep_2* sl) { m_surface_sweep = sl; }
/*! /*!