Fonction pour tracer seulement les points du maillage
[delaunay.git] / luamesh.sty
index 081cf5a..ccb1863 100644 (file)
   \fi%
 }%
 %
+%%%%%%%%%%%%%%%%% the trace Points macro
+%% engine of drawing
+\newif\ifluameshengineMP%
+\define@boolkey{tracePoints}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define@choicekey*{tracePoints}{bbox}[\val\nr]{none, show}{%
+  \ifcase\nr\relax%
+  \def\luameshval@tp@bbox{none}%
+  \or%
+  \def\luameshval@tp@bbox{bbox}%
+  \fi%
+}%
+%% the scale
+\define@key{tracePoints}{scale}[1cm]{\def\luameshval@tp@scale{#1}}%
+%% print points
+\define@choicekey*{tracePoints}{print}[\val\nr]{none, points}{%
+  \ifcase\nr\relax%
+  \def\luameshval@tp@print{none}%
+  \or%
+  \def\luameshval@tp@print{points}%
+  \fi%
+}%
+%% the name of the point
+\define@key{tracePoints}{meshpoint}[P]{\def\luameshval@tp@meshpoint{#1}}%
+%% the mode for reading the points
+\define@choicekey*{tracePoints}{mode}[\val\nr]{int, ext}{%
+  \ifcase\nr\relax%
+  \def\luameshval@tp@mode{int}%
+  \or%
+  \def\luameshval@tp@mode{ext}%
+  \fi%
+}%
+%
+% color
+%% the name of the color of drawing
+\define@key{tracePoints}{color}[black]{\def\luameshval@tp@color{#1}}%
+%% the name of the color of drawing the bbox
+\define@key{tracePoints}{colorBbox}[black]{\def\luameshval@tp@colorbbox{#1}}%
+%
+\presetkeys{tracePoints}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% the difinition BW Bowyer and Watson algo
+\newcommand{\tracePointsMesh}[2][]{%
+  % #1 : the string containing the list of points
+  % (x1,y1);(x2,y2);... or the name file containing the points
+  \setkeys{tracePoints}{#1} %
+  \def\MeshPoint{\luameshval@tp@meshpoint}%
+  \ifKV@buildMesh@tikz% if we are using tikz
+  \directlua{%
+    % buildMeshTikZ("#2","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","full","\luameshval@tp@scale","\luameshval@tp@color")%
+  }%
+  \else % we are using MP
+  \mplibcolor{\luameshmpcolor}{\luameshval@tp@color}
+  \mplibcolor{\luameshmpcolorBbox}{\luameshval@tp@colorbbox}
+  \directlua{%
+    printPointsMP("#2","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","\luameshval@tp@scale")%
+  }%
+  %
+  \fi%
+}%
+%
+
+%%%%%%%%%%%%%%%% the trace Points macro inc
+%% engine of drawing
+\newif\ifluameshengineMP%
+\define@boolkey{tracePointsInc}{tikz}[true]{}%
+%% show the bounding box for delaunay
+\define@choicekey*{tracePointsInc}{bbox}[\val\nr]{none, show}{%
+  \ifcase\nr\relax%
+  \def\luameshval@tp@bbox{none}%
+  \or%
+  \def\luameshval@tp@bbox{bbox}%
+  \fi%
+}%
+%% the scale
+\define@key{tracePointsInc}{scale}[1cm]{\def\luameshval@tp@scale{#1}}%
+%% print points
+\define@choicekey*{tracePointsInc}{print}[\val\nr]{none, points}{%
+  \ifcase\nr\relax%
+  \def\luameshval@tp@print{none}%
+  \or%
+  \def\luameshval@tp@print{points}%
+  \fi%
+}%
+%% the name of the point
+\define@key{tracePointsInc}{meshpoint}[P]{\def\luameshval@tp@meshpoint{#1}}%
+%% the mode for reading the points
+\define@choicekey*{tracePointsInc}{mode}[\val\nr]{int, ext}{%
+  \ifcase\nr\relax%
+  \def\luameshval@tp@mode{int}%
+  \or%
+  \def\luameshval@tp@mode{ext}%
+  \fi%
+}%
+%
+% color
+%% the name of the color of drawing
+\define@key{tracePointsInc}{color}[black]{\def\luameshval@tp@color{#1}}%
+%% the name of the color of drawing the bbox
+\define@key{tracePointsInc}{colorBbox}[black]{\def\luameshval@tp@colorbbox{#1}}%
+%
+\presetkeys{tracePointsInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% the difinition BW Bowyer and Watson algo
+\newcommand*{\tracePointsMeshinc}[4][]{%
+  % #1 : the string containing the list of points
+  % (x1,y1);(x2,y2);... or the name file containing the points
+  \setkeys{tracePointsInc}{#1} %
+  \def\MeshPoint{\luameshval@tp@meshpoint}%
+  \ifKV@tracePointsInc@tikz% if we are using tikz
+  \directlua{%
+    buildMeshTikZ("#2","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","full","\luameshval@tp@sc%ale","\luameshval@tp@color")%
+  }%
+  \else % we are using MP
+  \mplibcolor{\luameshmpcolor}{\luameshval@tp@color}
+  \mplibcolor{\luameshmpcolorBbox}{\luameshval@tp@colorbbox}
+  \directlua{%
+    printPointsMPinc("#2","#3","#4","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","\luameshval@tp@scale")%
+  }%
+  \fi%
+}%
 %
 %
 %%

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.