| 1 |
%tkz-obj-marks.tex |
| 2 |
% Copyright 2024 Alain Matthes |
| 3 |
% This work may be distributed and/or modified under the |
| 4 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 5 |
% of this license or (at your option) any later version. |
| 6 |
% The latest version of this license is in |
| 7 |
% http://www.latex-project.org/lppl.txt |
| 8 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 9 |
% version 2005/12/01 or later. |
| 10 |
% This work has the LPPL maintenance status “maintained”. |
| 11 |
% The Current Maintainer of this work is Alain Matthes. |
| 12 |
|
| 13 |
\def\fileversion{4.21c} |
| 14 |
\def\filedate{2024/01/16} |
| 15 |
\typeout{2024/01/16 4.21c tkz-obj-marks.tex} |
| 16 |
\makeatletter |
| 17 |
%<-------------------------------------------------------------------------–> |
| 18 |
% Setup Marks |
| 19 |
%<-------------------------------------------------------------------------–> |
| 20 |
%<--------------------------------------------------------------------------–> |
| 21 |
% DefSetOfPoints |
| 22 |
%<--------------------------------------------------------------------------–> |
| 23 |
\pgfkeys{/tkzSoPt/.cd, |
| 24 |
prefix/.store in = \tkz@pref, |
| 25 |
prefix = tkzPt, |
| 26 |
/tkzSoPt/.unknown/.code = {\let\searchname=\pgfkeyscurrentname |
| 27 |
\pgfkeysalso{\searchname/.try=#1, |
| 28 |
/tikz/\searchname/.retry=#1}} |
| 29 |
} |
| 30 |
\def\tkzDefSetOfPoints{\pgfutil@ifnextchar[{\tkz@SetOfPoints}{% |
| 31 |
\tkz@SetOfPoints[]}} |
| 32 |
\def\tkz@SetOfPoints[#1]#2{% |
| 33 |
\begingroup |
| 34 |
\pgfqkeys{/tkzSoPt}{#1} |
| 35 |
\tkz@cntmk1 % |
| 36 |
\edef\tkz@@cnt{\the\tkz@cntmk} |
| 37 |
\foreach \x/\y in {#2}{% |
| 38 |
\tkz@cntmk=\tkz@@cnt % |
| 39 |
\tkzDefPoint(\x,\y){\tkz@pref\the\tkz@cntmk} |
| 40 |
\advance\tkz@cntmk by1 % |
| 41 |
\xdef\tkz@@cnt{\the\tkz@cntmk} |
| 42 |
}% |
| 43 |
\endgroup |
| 44 |
}% |
| 45 |
%<-------------------------------------------------------------------------–> |
| 46 |
\pgfkeys{/tkzjoinmk/.cd, |
| 47 |
prefix/.store in = \tkz@pref, |
| 48 |
prefix = tkzPt, |
| 49 |
/tkzjoinmk/.search also = {/tikz} |
| 50 |
} |
| 51 |
\def\tkzJoinSetOfPoints{\pgfutil@ifnextchar[{\tkz@JoinSetOfPoints}{% |
| 52 |
\tkz@JoinSetOfPoints[]}} |
| 53 |
\def\tkz@JoinSetOfPoints[#1]{% |
| 54 |
\begingroup |
| 55 |
\pgfqkeys{/tkzjoinmk}{#1} |
| 56 |
\pgfmathsetcount{\tkz@cntmk}{\tkz@@cnt-2} |
| 57 |
\edef\tkz@@cnt{\the\tkz@cntmk} |
| 58 |
\foreach \nb in {1,...,\tkz@@cnt}{% |
| 59 |
\tkz@cntmk=\nb |
| 60 |
\advance\tkz@cntmk by1 |
| 61 |
\draw[line cap=round,/tkzjoinmk/.cd,#1] |
| 62 |
(\tkz@pref\nb) -- (\tkz@pref\the\tkz@cntmk);} |
| 63 |
\endgroup} |
| 64 |
%<-------------------------------------------------------------------------–> |
| 65 |
% ShowSetOfMark |
| 66 |
%<-------------------------------------------------------------------------–> |
| 67 |
\pgfkeys{/tkzdrawmk/.cd, |
| 68 |
prefix/.store in = \tkz@pref, |
| 69 |
prefix = tkzPt, |
| 70 |
/tkzdrawmk/.search also = {/tikz} |
| 71 |
} |
| 72 |
\def\tkzDrawSetOfPoints{\pgfutil@ifnextchar[{\tkz@DrawSetOfPoints}{ |
| 73 |
\tkz@DrawSetOfPoints[]}} |
| 74 |
\def\tkz@DrawSetOfPoints[#1]{% |
| 75 |
\begingroup |
| 76 |
\pgfqkeys{/tkzdrawmk}{#1} |
| 77 |
\pgfmathsetcount{\tkz@cntmk}{\tkz@@cnt-1} |
| 78 |
\foreach \nb in {1,...,\tkz@cntmk}{\tkzDrawMark[#1](\tkz@pref\nb)} |
| 79 |
\endgroup} |
| 80 |
%<-------------------------------------------------------------------------–> |
| 81 |
% tkzmark |
| 82 |
%<-------------------------------------------------------------------------–> |
| 83 |
\def\tkzDrawMark{\pgfutil@ifnextchar[{\tkz@DrawMark}{\tkz@DrawMark[]}} |
| 84 |
\def\tkz@DrawMark[#1](#2){% |
| 85 |
\draw plot[mark style,#1] coordinates {(#2)}; |
| 86 |
} |
| 87 |
%<---------------------------------------------------------–> |
| 88 |
%<---------------------------------------------------------–> |
| 89 |
\def\tkzDrawMarks{\pgfutil@ifnextchar[{\tkz@DrawMarks}{\tkz@DrawMarks[]}} |
| 90 |
\def\tkz@DrawMarks[#1](#2){% |
| 91 |
\foreach \point in {#2}{% |
| 92 |
\draw plot[mark style,#1] coordinates {(\point)};% StyleMark, |
| 93 |
}} |
| 94 |
%<------------------------------------------------------------–> |
| 95 |
% Init pour mark |
| 96 |
%<------------------------------------------------------------–> |
| 97 |
\pgfkeys{/setupmk/.cd, |
| 98 |
size/.store in = \tkz@sum@mk@size, |
| 99 |
color/.store in = \tkz@sum@mk@color, |
| 100 |
fill/.store in = \tkz@sum@mk@fill, |
| 101 |
mark/.store in = \tkz@sum@mk@mark, |
| 102 |
mark = \tkz@mk@mark, |
| 103 |
color = \tkz@mk@color, |
| 104 |
fill = \tkz@mk@color!50, |
| 105 |
size = \tkz@mk@size |
| 106 |
} |
| 107 |
\def\tkzSetUpMark{\pgfutil@ifnextchar[{\tkz@SetUpMark}{% |
| 108 |
\tkz@SetUpMark[]}} |
| 109 |
|
| 110 |
\def\tkz@SetUpMark[#1]{% |
| 111 |
\pgfqkeys{/setupmk}{#1} |
| 112 |
\tikzset{mark style/.style={% |
| 113 |
inner sep = 0pt, |
| 114 |
mark = \tkz@sum@mk@mark, |
| 115 |
mark size = \tkz@sum@mk@size, |
| 116 |
mark options = {color = \tkz@sum@mk@color, fill = \tkz@sum@mk@fill}}} |
| 117 |
}% |
| 118 |
\makeatother |
| 119 |
\endinput |