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

View File

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

View File

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

View File

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

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 \
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

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/property_map.h>
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 <typename Arrangement> 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();

View File

@ -4,13 +4,13 @@
// A property map that reads/writes the information to/from the extended face.
template <typename Arrangement, class Type> 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)

View File

@ -2,13 +2,13 @@
#define OVERLAY_COLOR_TRAITS_H
template <typename Arrangement> 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

View File

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

View File

@ -21,15 +21,15 @@ int main ()
#include "integer_type.h"
#include "arr_print.h"
typedef CGAL::Arr_algebraic_segment_traits_2<Integer> Traits;
typedef CGAL::Arrangement_2<Traits> 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;
using Traits = CGAL::Arr_algebraic_segment_traits_2<Integer>;
using Arrangement = CGAL::Arrangement_2<Traits>;
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;
typedef std::variant<Point, X_monotone_curve> Make_x_monotone_result;
using Make_x_monotone_result = std::variant<Point, X_monotone_curve>;
int main() {
Traits traits;

View File

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

View File

@ -5,16 +5,16 @@
#include <CGAL/Arr_circle_segment_traits_2.h>
#include <CGAL/Arrangement_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::FT Number_type;
typedef CGAL::Arr_circle_segment_traits_2<Kernel> 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<Traits> Arrangement;
using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
using Number_type = Kernel::FT;
using Traits = CGAL::Arr_circle_segment_traits_2<Kernel>;
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<Traits>;
#endif

View File

@ -5,19 +5,19 @@
#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arrangement_2.h>
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<Kernel> Traits;
typedef Traits::Point_2 Point;
typedef Traits::X_monotone_curve_2 Segment;
using Traits = CGAL::Arr_segment_traits_2<Kernel>;
using Point = Traits::Point_2;
using Segment = Traits::X_monotone_curve_2;
typedef CGAL::Arrangement_2<Traits> 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<Traits>;
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

View File

@ -6,21 +6,20 @@
#include <CGAL/Arr_geodesic_arc_on_sphere_traits_2.h>
#include <CGAL/Arr_spherical_topology_traits_2.h>
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<Kernel> 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<Geom_traits> Topol_traits;
typedef CGAL::Arrangement_on_surface_2<Geom_traits, Topol_traits>
Arrangement;
using Geom_traits = CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel>;
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<Geom_traits>;
using Arrangement = CGAL::Arrangement_on_surface_2<Geom_traits, Topol_traits>;
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

View File

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

View File

@ -5,22 +5,22 @@
#include <CGAL/Arr_linear_traits_2.h>
#include <CGAL/Arrangement_2.h>
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<Kernel> 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<Kernel>;
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<Traits> 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<Traits>;
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

View File

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

View File

@ -7,14 +7,14 @@
#include <CGAL/Arr_rational_function_traits_2.h>
#include <CGAL/Arrangement_2.h>
typedef CORE::BigInt Number_type;
typedef CGAL::Algebraic_kernel_d_1<Number_type> AK1;
typedef CGAL::Arr_rational_function_traits_2<AK1> Traits;
using Number_type = CORE::BigInt;
using AK1 = CGAL::Algebraic_kernel_d_1<Number_type>;
using Traits = CGAL::Arr_rational_function_traits_2<AK1>;
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<Traits> Arrangement;
using Arrangement = CGAL::Arrangement_2<Traits>;
#endif

View File

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

View File

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

View File

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

View File

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

View File

@ -15,23 +15,23 @@
#include <CGAL/Random.h>
typedef CGAL::Quotient<CGAL::MP_Float> NT;
typedef CGAL::Cartesian<NT> Linear_k;
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT> Algebraic_k;
typedef CGAL::Circular_kernel_2<Linear_k,Algebraic_k> Circular_k;
using NT = CGAL::Quotient<CGAL::MP_Float>;
using Linear_k = CGAL::Cartesian<NT>;
using Algebraic_k = CGAL::Algebraic_kernel_for_circles_2_2<NT>;
using Circular_k = CGAL::Circular_kernel_2<Linear_k,Algebraic_k>;
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<Circular_k> Traits;
using Traits = CGAL::Arr_circular_line_arc_traits_2<Circular_k>;
typedef CGAL::Arrangement_2<Traits> Arrangement;
typedef CGAL::Arr_naive_point_location<Arrangement> Point_location;
using Arrangement = CGAL::Arrangement_2<Traits>;
using Point_location = CGAL::Arr_naive_point_location<Arrangement>;
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));

View File

@ -11,7 +11,7 @@
#include "arr_conics.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() {
Traits traits;

View File

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

View File

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

View File

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

View File

@ -31,9 +31,9 @@ std::istream& operator>>(std::istream& is, Color& color) {
return is;
}
typedef CGAL::Arr_extended_dcel<Traits, Color, bool, int> Ext_dcel;
typedef CGAL::Arrangement_2<Traits, Ext_dcel> Ext_arrangement;
typedef CGAL::Arr_extended_dcel_text_formatter<Ext_arrangement> Formatter;
using Ext_dcel = CGAL::Arr_extended_dcel<Traits, Color, bool, int>;
using Ext_arrangement = CGAL::Arrangement_2<Traits, Ext_dcel>;
using Formatter = CGAL::Arr_extended_dcel_text_formatter<Ext_arrangement>;
int main() {
// 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/Arr_segment_traits_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 Point = Traits::Point_2;
using Arrangement_2 = CGAL::Arrangement_2<Traits>;

View File

@ -10,9 +10,9 @@
#include "arr_linear.h"
#include "read_objects.h"
typedef CGAL::Arr_curve_data_traits_2<Traits, size_t> Data_traits;
typedef Data_traits::X_monotone_curve_2 Data_x_monotone_curve_2;
typedef CGAL::Arrangement_2<Data_traits> Data_arrangement;
using Data_traits = CGAL::Arr_curve_data_traits_2<Traits, size_t>;
using Data_x_monotone_curve_2 = Data_traits::X_monotone_curve_2;
using Data_arrangement = CGAL::Arrangement_2<Data_traits>;
int main(int argc, char* argv[]) {
// 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_print.h"
typedef CGAL::Arrangement_with_history_2<Traits> Arr_with_hist;
typedef Arr_with_hist::Curve_handle Curve_handle;
typedef CGAL::Arr_walk_along_line_point_location<Arr_with_hist> Point_location;
using Arr_with_hist = CGAL::Arrangement_with_history_2<Traits>;
using Curve_handle = Arr_with_hist::Curve_handle;
using Point_location = CGAL::Arr_walk_along_line_point_location<Arr_with_hist>;
int main() {
// Construct an arrangement containing nine circles: C[0] of radius 2 and

View File

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

View File

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

View File

@ -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<Traits, Name, Merge_names>
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_traits> Ex_arrangement;
using Ex_traits = CGAL::Arr_curve_data_traits_2<Traits, Name, Merge_names>;
using Ex_polyline = Ex_traits::Curve_2;
using Ex_x_monotone_polyline = Ex_traits::X_monotone_curve_2;
using Ex_arrangement = CGAL::Arrangement_2<Ex_traits>;
int main() {
// Construct an arrangement of four polylines named A--D.

View File

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

View File

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

View File

@ -10,7 +10,7 @@
#include "arr_exact_construction_segments.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() {
// Insert six additional segments aggregately:

View File

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

View File

@ -16,15 +16,15 @@ struct Overlay_label {
{ return c + std::to_string(i); }
};
typedef CGAL::Arr_face_extended_dcel<Traits, char> Dcel_dlue;
typedef CGAL::Arrangement_2<Traits, Dcel_dlue> Arrangement_blue;
typedef CGAL::Arr_face_extended_dcel<Traits, unsigned int> Dcel_red;
typedef CGAL::Arrangement_2<Traits, Dcel_red> Arrangement_red;
typedef CGAL::Arr_face_extended_dcel<Traits, std::string> Dcel_res;
typedef CGAL::Arrangement_2<Traits, Dcel_res> Arrangement_res;
typedef CGAL::Arr_face_overlay_traits<Arrangement_blue, Arrangement_red,
Arrangement_res, Overlay_label>
Overlay_traits;
using Dcel_dlue = CGAL::Arr_face_extended_dcel<Traits, char>;
using Arrangement_blue = CGAL::Arrangement_2<Traits, Dcel_dlue>;
using Dcel_red = CGAL::Arr_face_extended_dcel<Traits, unsigned int>;
using Arrangement_red = CGAL::Arrangement_2<Traits, Dcel_red>;
using Dcel_res = CGAL::Arr_face_extended_dcel<Traits, std::string>;
using Arrangement_res = CGAL::Arrangement_2<Traits, Dcel_res>;
using Overlay_traits =
CGAL::Arr_face_overlay_traits<Arrangement_blue, Arrangement_red,
Arrangement_res, Overlay_label>;
int main() {
// 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 "point_location_utils.h"
typedef CGAL::Arr_naive_point_location<Arrangement> Naive_pl;
typedef CGAL::Arr_landmarks_point_location<Arrangement> Landmarks_pl;
using Naive_pl = CGAL::Arr_naive_point_location<Arrangement>;
using Landmarks_pl = CGAL::Arr_landmarks_point_location<Arrangement>;
int main() {
// Construct the arrangement.

View File

@ -9,10 +9,10 @@ void print_point_location
(const typename Arrangement_::Point_2& q,
typename CGAL::Arr_point_location_result<Arrangement_>::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<Arrangement_2>::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 <typename Arrangement_>
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);

View File

@ -19,12 +19,12 @@ int main() {
#include "arr_Bezier.h"
#include "arr_print.h"
typedef CGAL::Arr_polycurve_traits_2<Traits> 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<Polycurve_bezier_traits> Arrangement_2;
using Polycurve_bezier_traits = CGAL::Arr_polycurve_traits_2<Traits>;
using Point = Polycurve_bezier_traits::Point_2;
using X_mono_polycurve = Polycurve_bezier_traits::X_monotone_curve_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() {
Polycurve_bezier_traits pc_traits;

View File

@ -22,11 +22,11 @@ int main() {
#include "arr_circular.h"
#include "arr_print.h"
typedef CGAL::Arr_polycurve_traits_2<Traits> 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_traits> Polycurve_circ_arc_arrangment;
using Polycurve_traits = CGAL::Arr_polycurve_traits_2<Traits>;
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<Polycurve_traits>;
int main() {
Polycurve_traits traits;

View File

@ -21,10 +21,10 @@ int main() {
#include "arr_conics.h"
#include "arr_print.h"
typedef CGAL::Arr_polycurve_traits_2<Traits> 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_traits_2> Polycurve_conic_arrangment;
using Polycurve_conic_traits_2 = CGAL::Arr_polycurve_traits_2<Traits>;
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<Polycurve_conic_traits_2>;
int main() {
Traits sub_traits;

View File

@ -10,31 +10,29 @@
#include <CGAL/Arr_polyline_traits_2.h>
#include <CGAL/Arrangement_on_surface_2.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel> Segment_traits_2;
typedef CGAL::Arr_polyline_traits_2<Segment_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<Kernel>;
using Poly_traits_2 = CGAL::Arr_polyline_traits_2<Segment_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<Poly_traits_2>
Topol_poly_traits_2;
typedef CGAL::Arrangement_on_surface_2<Poly_traits_2, Topol_poly_traits_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<Poly_traits_2>;
using Poly_arr =
CGAL::Arrangement_on_surface_2<Poly_traits_2, Topol_poly_traits_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<Segment_traits_2>
Topol_segment_traits_2;
typedef CGAL::Arrangement_on_surface_2<Segment_traits_2, Topol_segment_traits_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<Segment_traits_2>;
using Segment_arr =
CGAL::Arrangement_on_surface_2<Segment_traits_2, Topol_segment_traits_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));

View File

@ -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<Kernel>
Subcurve_traits;
typedef CGAL::Arr_polycurve_basic_traits_2<Subcurve_traits> 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<Geom_traits> Arrangement;
using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
using Subcurve_traits =
CGAL::Arr_directional_non_caching_segment_basic_traits_2<Kernel>;
using Geom_traits = CGAL::Arr_polycurve_basic_traits_2<Subcurve_traits>;
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<Geom_traits>;
int main() {
Geom_traits traits;

View File

@ -3,9 +3,9 @@
// predefined kernel with exact constructions and exact predicates.
#include <list>
#include <chrono>
#include <CGAL/basic.h>
#include <CGAL/Timer.h>
#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<double> 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;
}

View File

@ -2,19 +2,20 @@
// Constructing an arrangement of non-intersecting line segments using the
// predefined kernel with exact predicates.
#include <list>
#include <fstream>
#include <chrono>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Arr_non_caching_segment_basic_traits_2.h>
#include <CGAL/Arrangement_2.h>
#include <CGAL/Timer.h>
#include <list>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT Number_type;
typedef CGAL::Arr_non_caching_segment_basic_traits_2<Kernel> Traits_2;
typedef Traits_2::Point_2 Point_2;
typedef Traits_2::X_monotone_curve_2 Segment_2;
typedef CGAL::Arrangement_2<Traits_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<Kernel>;
using Point_2 = Traits_2::Point_2;
using Segment_2 = Traits_2::X_monotone_curve_2;
using Arrangement_2 = CGAL::Arrangement_2<Traits_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[]) {
// <sx_n> <sy_n> <tx_n> <ty_n> // source and target of segment #n.
std::list<Segment_2> 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<double> 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;
}

View File

@ -18,23 +18,22 @@ int main() {
#include <CGAL/Arr_rational_function_traits_2.h> // Traits
#include <CGAL/Arrangement_2.h> // Arrangement
typedef CORE::BigInt Integer;
typedef CORE::BigRat Rational;
typedef CGAL::Algebraic_kernel_d_1<Integer> AK1;
typedef CGAL::Arr_rational_function_traits_2<AK1> Traits_2;
using Integer = CORE::BigInt;
using Rational = CORE::BigRat;
using AK1 = CGAL::Algebraic_kernel_d_1<Integer>;
using Traits_2 = CGAL::Arr_rational_function_traits_2<AK1>;
typedef std::vector<Rational> Rat_vec;
typedef Traits_2::Algebraic_real_1 Alg_real_1;
using Rat_vec = std::vector<Rational>;
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 () {
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<Traits_2::X_monotone_curve_2> arcs;

View File

@ -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<Kernel, -8, 6> Gm_traits;
using Gm_traits = CGAL::Arr_polyhedral_sgm_traits<Kernel, -8, 6>;
#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
typedef CGAL::Arr_polyhedral_sgm_traits<Kernel, -1, 0> Gm_traits;
using Gm_traits = CGAL::Arr_polyhedral_sgm_traits<Kernel, -1, 0>;
#endif
typedef CGAL::Arr_polyhedral_sgm<Gm_traits> Gm;
typedef CGAL::Arr_polyhedral_sgm_polyhedron_3<Gm, Kernel> Gm_polyhedron;
typedef CGAL::Arr_polyhedral_sgm_initializer<Gm, Gm_polyhedron> Gm_initializer;
using Gm = CGAL::Arr_polyhedral_sgm<Gm_traits>;
using Gm_polyhedron = CGAL::Arr_polyhedral_sgm_polyhedron_3<Gm, Kernel>;
using Gm_initializer = CGAL::Arr_polyhedral_sgm_initializer<Gm, Gm_polyhedron>;
typedef CGAL::Arr_naive_point_location<Gm> Naive_pl;
typedef CGAL::Arr_walk_along_line_point_location<Gm> Walk_pl;
typedef CGAL::Arr_landmarks_point_location<Gm> Landmarks_pl;
typedef CGAL::Arr_trapezoid_ric_point_location<Gm> Trap_pl;
using Naive_pl = CGAL::Arr_naive_point_location<Gm>;
using Walk_pl = CGAL::Arr_walk_along_line_point_location<Gm>;
using Landmarks_pl = CGAL::Arr_landmarks_point_location<Gm>;
using Trap_pl = CGAL::Arr_trapezoid_ric_point_location<Gm>;
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<Gm> Point_location_result;
typedef std::pair<Point_2, Point_location_result::Type> Query_result;
using Point_location_result = CGAL::Arr_point_location_result<Gm>;
using Query_result = std::pair<Point_2, Point_location_result::Type>;
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 @@ protected:
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),

View File

@ -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<Kernel, -8, 6> Geom_traits_2;
using Geom_traits_2 = CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel, -8, 6>;
#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
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
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<Geom_traits_2> Topol_traits_2;
typedef CGAL::Arrangement_on_surface_2<Geom_traits_2, Topol_traits_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<Geom_traits_2>;
using Arrangement_2 =
CGAL::Arrangement_on_surface_2<Geom_traits_2, Topol_traits_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<Point_2> points;
std::vector<X_monotone_curve_2> xcvs;
CGAL::IO::set_pretty_mode(std::cout);

View File

@ -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<Kernel> Geom_traits;
typedef Geom_traits::Point_2 Point;
typedef Geom_traits::Curve_2 Curve;
typedef CGAL::Arr_spherical_topology_traits_2<Geom_traits> Topol_traits;
typedef CGAL::Arrangement_on_surface_2<Geom_traits, Topol_traits> Arrangement;
using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
using Geom_traits = CGAL::Arr_geodesic_arc_on_sphere_traits_2<Kernel>;
using Point = Geom_traits::Point_2;
using Curve = Geom_traits::Curve_2;
using Topol_traits = CGAL::Arr_spherical_topology_traits_2<Geom_traits>;
using Arrangement = CGAL::Arrangement_on_surface_2<Geom_traits, Topol_traits>;
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;
}

View File

@ -7,7 +7,7 @@
#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() {
Geom_traits traits;

View File

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

View File

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

View File

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

View File

@ -141,15 +141,15 @@ public:
/*! 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 @@ public:
*/
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 @@ public:
* \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 @@ public:
*/
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 @@ public:
*/
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 @@ public:
* \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());

View File

@ -247,27 +247,32 @@ public:
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 <typename T>
bool are_mergeable_data(const T& /* cv1 */, const T& /* cv2 */, long) const {
CGAL_error_msg("Equality operator is not supported.");
return 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
* has a nested type named Are_mergeable_2.
*/
template <typename GeomeTraits_2>
std::enable_if_t<has_are_mergeable_2<GeomeTraits_2>::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 @@ public:
* This function should never be called!
*/
template <typename GeomeTraits_2>
std::enable_if_t<!has_are_mergeable_2<GeomeTraits_2>::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 @@ public:
*/
bool operator()(const X_monotone_curve_2& cv1,
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. */

View File

@ -19,30 +19,61 @@
#include <iostream>
#include <list>
#include <algorithm>
#include <CGAL/basic.h>
#include <CGAL/General_polygon_set_2.h>
namespace CGAL {
template <typename Traits>
std::ostream & operator<< (std::ostream& os,
const CGAL::General_polygon_set_2<Traits> & pgn_set)
{
typedef typename CGAL::General_polygon_set_2<Traits>::Polygon_with_holes_2
Polygon_with_holes_2;
typedef std::list<Polygon_with_holes_2> 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 <typename GeomTraits_, typename Dcel_>
std::ostream&
operator<<(std::ostream& os,
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::copy(res.begin(), res.end(),
std::ostream_iterator<Polygon_with_holes_2>(std::cout, "\n"));
std::copy(pwhs.begin(), pwhs.end(), std::ostream_iterator<Pwh_2>(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 <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
#include <CGAL/enable_warnings.h>

View File

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

View File

@ -84,7 +84,7 @@ public:
/*! 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; }
/*!