├── .gitignore ├── LICENSE ├── README.md ├── example ├── paths.ortho-hvvh.tex └── paths.ortho-udlr.tex ├── gnu-public-license-2.txt ├── latex-project-public-license-1.3c.txt ├── pgflibraryqrr.shapes.heat.code.tex ├── pgflibraryqrr.shapes.openrectangle.code.tex ├── pgflibraryqrr.shapes.roundedrectangle.code.tex ├── pgflibraryqrr.shapes.roundedrectangle2.code.tex ├── tikzlibraryarcs.code.tex ├── tikzlibrarynorm.code.tex ├── tikzlibraryqrr.arc.code.tex └── tikzlibraryqrr.labels-pins-plus.code.tex /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | archive/ 15 | 16 | # Local configuration file (sdk path, etc) 17 | local.properties 18 | 19 | # Eclipse project files 20 | .classpath 21 | .project 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The code of this package is dual-license. This means that 2 | you can decide which license you wish to use when using the 3 | package. The two options are: 4 | 5 | a) You can use the GNU Public License, version 2. 6 | b) You can use the LaTeX Project Public License, version 1.3c. 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | As per [#1](https://github.com/Qrrbrbirlbel/pgf/issues/1) all files are dual-licensed with 4 | 5 | * GNU Public License, version 2. 6 | * LaTeX Project Public License, version 1.3c. 7 | 8 | # Missing libraries. 9 | Missing libraries are deprecated and can be replaced by the [`tikz-ext` package](https://ctan.org/pkg/tikz-ext). 10 | See [its own repository](https://github.com/Qrrbrbirlbel/tikz-extensions). 11 | 12 | # Libraries for PGF or TikZ 13 | See [the wiki](https://github.com/Qrrbrbirlbel/pgf/wiki) for a description of the libraries. 14 | 15 | # Installation 16 | There are two ways to install these custom libraries for use with one's own documents: 17 | 18 | 1. Placing them besides the document's main TeX file 19 | 2. Placing them in the local [texmf tree](https://tex.stackexchange.com/q/420620/16595) 20 | -------------------------------------------------------------------------------- /example/paths.ortho-hvvh.tex: -------------------------------------------------------------------------------- 1 | \documentclass[tikz,convert=false]{standalone} 2 | \usetikzlibrary{paths.ortho,backgrounds} 3 | \def\foreachfour{\foreach \pos in {0,.125,.25,.5,.75,.875,1}{node[pos=\pos] {\pos}}} 4 | \def\foreachthree{\foreach \pos in {0,.1666,.3333,.5,.6667,.8333,1}{node[pos=\pos] {\pos}}} 5 | \def\foreachzero{\foreach \pos in {-1,-.5,0,.5,1,1.5,2}{node[pos=\pos] {\pos}}} 6 | \begin{document} 7 | \foreach \Ratio in {0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1,.9,.8,.7,.6,.5,.4,.3,.2,.1}{ 8 | \begin{tikzpicture}[hvvh/ratio/.expanded=\Ratio,show background grid] 9 | \node[opacity=0] at (8,0) {.3333}; 10 | \draw (1,1) |-| ++(3,4) \foreachfour; 11 | \draw[blue] (5,1) -|- ++(3,4) \foreachfour; 12 | 13 | \scope[yshift=-5cm,hvvh/spacing=3] 14 | \draw (1,1) |-| ++(3,4) \foreachthree; 15 | \draw[blue] (5,1) -|- ++(3,4) \foreachthree; 16 | \endscope 17 | 18 | \scope[yshift=-10cm,hvvh/spacing=0] 19 | \draw (1,1) |-| ++(3,4) \foreachzero; 20 | \draw[blue] (5,1) -|- ++(3,4) \foreachzero; 21 | \endscope 22 | \end{tikzpicture}} 23 | \end{document} 24 | -------------------------------------------------------------------------------- /example/paths.ortho-udlr.tex: -------------------------------------------------------------------------------- 1 | \documentclass[tikz,convert=false]{standalone} 2 | \usetikzlibrary{paths.ortho,backgrounds} 3 | \def\foreachfour{\foreach \pos in {0,.125,.25,.5,.75,.875,1}{node[pos=\pos] {\pos}}} 4 | \def\foreachthree{\foreach \pos in {0,.1666,.3333,.5,.6667,.8333,1}{node[pos=\pos] {\pos}}} 5 | \def\foreachzero{\foreach \pos in {-1,-.5,0,.5,1,1.5,2}{node[pos=\pos] {\pos}}} 6 | \begin{document} 7 | \foreach \Distance in {0,.2,.4,.5,.6,.8,1,1.2,1.4,1.5,1.6,1.8,2,1.8,1.6,1.5,1.4,1.2,1,.8,.6,.5,.4,.2,0}{ 8 | \begin{tikzpicture}[udlr/distance=\Distance cm, hvvh/distance=\Distance cm, show background grid] 9 | \node[opacity=0] at (8,0) {.3333}; 10 | \draw (1,1) r-ud ++(3,4) \foreachfour; 11 | \draw[blue] (5,1) r-rl ++(3,4) \foreachfour ++(2,2) node[opacity=0] {.75}; 12 | 13 | \scope[yshift=-5cm,hvvh/spacing=3] 14 | \draw (1,1) r-du ++(3,4) \foreachthree; 15 | \draw[blue] (5,1) r-lr ++(3,4) \foreachthree; 16 | \endscope 17 | 18 | \scope[yshift=-10cm,hvvh/spacing=0] 19 | \draw (1,1) |-| ++(3,4) \foreachzero; 20 | \draw[blue] (5,1) -|- ++(3,4) \foreachzero; 21 | \endscope 22 | \end{tikzpicture}} 23 | 24 | \end{document} 25 | -------------------------------------------------------------------------------- /gnu-public-license-2.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /latex-project-public-license-1.3c.txt: -------------------------------------------------------------------------------- 1 | The LaTeX Project Public License 2 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 3 | 4 | LPPL Version 1.3c 2006-05-20 5 | 6 | Copyright 1999 2002-2006 LaTeX3 Project 7 | Everyone is allowed to distribute verbatim copies of this 8 | license document, but modification of it is not allowed. 9 | 10 | 11 | PREAMBLE 12 | ======== 13 | 14 | The LaTeX Project Public License (LPPL) is the primary license under 15 | which the the LaTeX kernel and the base LaTeX packages are distributed. 16 | 17 | You may use this license for any work of which you hold the copyright 18 | and which you wish to distribute. This license may be particularly 19 | suitable if your work is TeX-related (such as a LaTeX package), but 20 | it is written in such a way that you can use it even if your work is 21 | unrelated to TeX. 22 | 23 | The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', 24 | below, gives instructions, examples, and recommendations for authors 25 | who are considering distributing their works under this license. 26 | 27 | This license gives conditions under which a work may be distributed 28 | and modified, as well as conditions under which modified versions of 29 | that work may be distributed. 30 | 31 | We, the LaTeX3 Project, believe that the conditions below give you 32 | the freedom to make and distribute modified versions of your work 33 | that conform with whatever technical specifications you wish while 34 | maintaining the availability, integrity, and reliability of 35 | that work. If you do not see how to achieve your goal while 36 | meeting these conditions, then read the document `cfgguide.tex' 37 | and `modguide.tex' in the base LaTeX distribution for suggestions. 38 | 39 | 40 | DEFINITIONS 41 | =========== 42 | 43 | In this license document the following terms are used: 44 | 45 | `Work' 46 | Any work being distributed under this License. 47 | 48 | `Derived Work' 49 | Any work that under any applicable law is derived from the Work. 50 | 51 | `Modification' 52 | Any procedure that produces a Derived Work under any applicable 53 | law -- for example, the production of a file containing an 54 | original file associated with the Work or a significant portion of 55 | such a file, either verbatim or with modifications and/or 56 | translated into another language. 57 | 58 | `Modify' 59 | To apply any procedure that produces a Derived Work under any 60 | applicable law. 61 | 62 | `Distribution' 63 | Making copies of the Work available from one person to another, in 64 | whole or in part. Distribution includes (but is not limited to) 65 | making any electronic components of the Work accessible by 66 | file transfer protocols such as FTP or HTTP or by shared file 67 | systems such as Sun's Network File System (NFS). 68 | 69 | `Compiled Work' 70 | A version of the Work that has been processed into a form where it 71 | is directly usable on a computer system. This processing may 72 | include using installation facilities provided by the Work, 73 | transformations of the Work, copying of components of the Work, or 74 | other activities. Note that modification of any installation 75 | facilities provided by the Work constitutes modification of the Work. 76 | 77 | `Current Maintainer' 78 | A person or persons nominated as such within the Work. If there is 79 | no such explicit nomination then it is the `Copyright Holder' under 80 | any applicable law. 81 | 82 | `Base Interpreter' 83 | A program or process that is normally needed for running or 84 | interpreting a part or the whole of the Work. 85 | 86 | A Base Interpreter may depend on external components but these 87 | are not considered part of the Base Interpreter provided that each 88 | external component clearly identifies itself whenever it is used 89 | interactively. Unless explicitly specified when applying the 90 | license to the Work, the only applicable Base Interpreter is a 91 | `LaTeX-Format' or in the case of files belonging to the 92 | `LaTeX-format' a program implementing the `TeX language'. 93 | 94 | 95 | 96 | CONDITIONS ON DISTRIBUTION AND MODIFICATION 97 | =========================================== 98 | 99 | 1. Activities other than distribution and/or modification of the Work 100 | are not covered by this license; they are outside its scope. In 101 | particular, the act of running the Work is not restricted and no 102 | requirements are made concerning any offers of support for the Work. 103 | 104 | 2. You may distribute a complete, unmodified copy of the Work as you 105 | received it. Distribution of only part of the Work is considered 106 | modification of the Work, and no right to distribute such a Derived 107 | Work may be assumed under the terms of this clause. 108 | 109 | 3. You may distribute a Compiled Work that has been generated from a 110 | complete, unmodified copy of the Work as distributed under Clause 2 111 | above, as long as that Compiled Work is distributed in such a way that 112 | the recipients may install the Compiled Work on their system exactly 113 | as it would have been installed if they generated a Compiled Work 114 | directly from the Work. 115 | 116 | 4. If you are the Current Maintainer of the Work, you may, without 117 | restriction, modify the Work, thus creating a Derived Work. You may 118 | also distribute the Derived Work without restriction, including 119 | Compiled Works generated from the Derived Work. Derived Works 120 | distributed in this manner by the Current Maintainer are considered to 121 | be updated versions of the Work. 122 | 123 | 5. If you are not the Current Maintainer of the Work, you may modify 124 | your copy of the Work, thus creating a Derived Work based on the Work, 125 | and compile this Derived Work, thus creating a Compiled Work based on 126 | the Derived Work. 127 | 128 | 6. If you are not the Current Maintainer of the Work, you may 129 | distribute a Derived Work provided the following conditions are met 130 | for every component of the Work unless that component clearly states 131 | in the copyright notice that it is exempt from that condition. Only 132 | the Current Maintainer is allowed to add such statements of exemption 133 | to a component of the Work. 134 | 135 | a. If a component of this Derived Work can be a direct replacement 136 | for a component of the Work when that component is used with the 137 | Base Interpreter, then, wherever this component of the Work 138 | identifies itself to the user when used interactively with that 139 | Base Interpreter, the replacement component of this Derived Work 140 | clearly and unambiguously identifies itself as a modified version 141 | of this component to the user when used interactively with that 142 | Base Interpreter. 143 | 144 | b. Every component of the Derived Work contains prominent notices 145 | detailing the nature of the changes to that component, or a 146 | prominent reference to another file that is distributed as part 147 | of the Derived Work and that contains a complete and accurate log 148 | of the changes. 149 | 150 | c. No information in the Derived Work implies that any persons, 151 | including (but not limited to) the authors of the original version 152 | of the Work, provide any support, including (but not limited to) 153 | the reporting and handling of errors, to recipients of the 154 | Derived Work unless those persons have stated explicitly that 155 | they do provide such support for the Derived Work. 156 | 157 | d. You distribute at least one of the following with the Derived Work: 158 | 159 | 1. A complete, unmodified copy of the Work; 160 | if your distribution of a modified component is made by 161 | offering access to copy the modified component from a 162 | designated place, then offering equivalent access to copy 163 | the Work from the same or some similar place meets this 164 | condition, even though third parties are not compelled to 165 | copy the Work along with the modified component; 166 | 167 | 2. Information that is sufficient to obtain a complete, 168 | unmodified copy of the Work. 169 | 170 | 7. If you are not the Current Maintainer of the Work, you may 171 | distribute a Compiled Work generated from a Derived Work, as long as 172 | the Derived Work is distributed to all recipients of the Compiled 173 | Work, and as long as the conditions of Clause 6, above, are met with 174 | regard to the Derived Work. 175 | 176 | 8. The conditions above are not intended to prohibit, and hence do not 177 | apply to, the modification, by any method, of any component so that it 178 | becomes identical to an updated version of that component of the Work as 179 | it is distributed by the Current Maintainer under Clause 4, above. 180 | 181 | 9. Distribution of the Work or any Derived Work in an alternative 182 | format, where the Work or that Derived Work (in whole or in part) is 183 | then produced by applying some process to that format, does not relax or 184 | nullify any sections of this license as they pertain to the results of 185 | applying that process. 186 | 187 | 10. a. A Derived Work may be distributed under a different license 188 | provided that license itself honors the conditions listed in 189 | Clause 6 above, in regard to the Work, though it does not have 190 | to honor the rest of the conditions in this license. 191 | 192 | b. If a Derived Work is distributed under a different license, that 193 | Derived Work must provide sufficient documentation as part of 194 | itself to allow each recipient of that Derived Work to honor the 195 | restrictions in Clause 6 above, concerning changes from the Work. 196 | 197 | 11. This license places no restrictions on works that are unrelated to 198 | the Work, nor does this license place any restrictions on aggregating 199 | such works with the Work by any means. 200 | 201 | 12. Nothing in this license is intended to, or may be used to, prevent 202 | complete compliance by all parties with all applicable laws. 203 | 204 | 205 | NO WARRANTY 206 | =========== 207 | 208 | There is no warranty for the Work. Except when otherwise stated in 209 | writing, the Copyright Holder provides the Work `as is', without 210 | warranty of any kind, either expressed or implied, including, but not 211 | limited to, the implied warranties of merchantability and fitness for a 212 | particular purpose. The entire risk as to the quality and performance 213 | of the Work is with you. Should the Work prove defective, you assume 214 | the cost of all necessary servicing, repair, or correction. 215 | 216 | In no event unless required by applicable law or agreed to in writing 217 | will The Copyright Holder, or any author named in the components of the 218 | Work, or any other party who may distribute and/or modify the Work as 219 | permitted above, be liable to you for damages, including any general, 220 | special, incidental or consequential damages arising out of any use of 221 | the Work or out of inability to use the Work (including, but not limited 222 | to, loss of data, data being rendered inaccurate, or losses sustained by 223 | anyone as a result of any failure of the Work to operate with any other 224 | programs), even if the Copyright Holder or said author or said other 225 | party has been advised of the possibility of such damages. 226 | 227 | 228 | MAINTENANCE OF THE WORK 229 | ======================= 230 | 231 | The Work has the status `author-maintained' if the Copyright Holder 232 | explicitly and prominently states near the primary copyright notice in 233 | the Work that the Work can only be maintained by the Copyright Holder 234 | or simply that it is `author-maintained'. 235 | 236 | The Work has the status `maintained' if there is a Current Maintainer 237 | who has indicated in the Work that they are willing to receive error 238 | reports for the Work (for example, by supplying a valid e-mail 239 | address). It is not required for the Current Maintainer to acknowledge 240 | or act upon these error reports. 241 | 242 | The Work changes from status `maintained' to `unmaintained' if there 243 | is no Current Maintainer, or the person stated to be Current 244 | Maintainer of the work cannot be reached through the indicated means 245 | of communication for a period of six months, and there are no other 246 | significant signs of active maintenance. 247 | 248 | You can become the Current Maintainer of the Work by agreement with 249 | any existing Current Maintainer to take over this role. 250 | 251 | If the Work is unmaintained, you can become the Current Maintainer of 252 | the Work through the following steps: 253 | 254 | 1. Make a reasonable attempt to trace the Current Maintainer (and 255 | the Copyright Holder, if the two differ) through the means of 256 | an Internet or similar search. 257 | 258 | 2. If this search is successful, then enquire whether the Work 259 | is still maintained. 260 | 261 | a. If it is being maintained, then ask the Current Maintainer 262 | to update their communication data within one month. 263 | 264 | b. If the search is unsuccessful or no action to resume active 265 | maintenance is taken by the Current Maintainer, then announce 266 | within the pertinent community your intention to take over 267 | maintenance. (If the Work is a LaTeX work, this could be 268 | done, for example, by posting to comp.text.tex.) 269 | 270 | 3a. If the Current Maintainer is reachable and agrees to pass 271 | maintenance of the Work to you, then this takes effect 272 | immediately upon announcement. 273 | 274 | b. If the Current Maintainer is not reachable and the Copyright 275 | Holder agrees that maintenance of the Work be passed to you, 276 | then this takes effect immediately upon announcement. 277 | 278 | 4. If you make an `intention announcement' as described in 2b. above 279 | and after three months your intention is challenged neither by 280 | the Current Maintainer nor by the Copyright Holder nor by other 281 | people, then you may arrange for the Work to be changed so as 282 | to name you as the (new) Current Maintainer. 283 | 284 | 5. If the previously unreachable Current Maintainer becomes 285 | reachable once more within three months of a change completed 286 | under the terms of 3b) or 4), then that Current Maintainer must 287 | become or remain the Current Maintainer upon request provided 288 | they then update their communication data within one month. 289 | 290 | A change in the Current Maintainer does not, of itself, alter the fact 291 | that the Work is distributed under the LPPL license. 292 | 293 | If you become the Current Maintainer of the Work, you should 294 | immediately provide, within the Work, a prominent and unambiguous 295 | statement of your status as Current Maintainer. You should also 296 | announce your new status to the same pertinent community as 297 | in 2b) above. 298 | 299 | 300 | WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE 301 | ====================================================== 302 | 303 | This section contains important instructions, examples, and 304 | recommendations for authors who are considering distributing their 305 | works under this license. These authors are addressed as `you' in 306 | this section. 307 | 308 | Choosing This License or Another License 309 | ---------------------------------------- 310 | 311 | If for any part of your work you want or need to use *distribution* 312 | conditions that differ significantly from those in this license, then 313 | do not refer to this license anywhere in your work but, instead, 314 | distribute your work under a different license. You may use the text 315 | of this license as a model for your own license, but your license 316 | should not refer to the LPPL or otherwise give the impression that 317 | your work is distributed under the LPPL. 318 | 319 | The document `modguide.tex' in the base LaTeX distribution explains 320 | the motivation behind the conditions of this license. It explains, 321 | for example, why distributing LaTeX under the GNU General Public 322 | License (GPL) was considered inappropriate. Even if your work is 323 | unrelated to LaTeX, the discussion in `modguide.tex' may still be 324 | relevant, and authors intending to distribute their works under any 325 | license are encouraged to read it. 326 | 327 | A Recommendation on Modification Without Distribution 328 | ----------------------------------------------------- 329 | 330 | It is wise never to modify a component of the Work, even for your own 331 | personal use, without also meeting the above conditions for 332 | distributing the modified component. While you might intend that such 333 | modifications will never be distributed, often this will happen by 334 | accident -- you may forget that you have modified that component; or 335 | it may not occur to you when allowing others to access the modified 336 | version that you are thus distributing it and violating the conditions 337 | of this license in ways that could have legal implications and, worse, 338 | cause problems for the community. It is therefore usually in your 339 | best interest to keep your copy of the Work identical with the public 340 | one. Many works provide ways to control the behavior of that work 341 | without altering any of its licensed components. 342 | 343 | How to Use This License 344 | ----------------------- 345 | 346 | To use this license, place in each of the components of your work both 347 | an explicit copyright notice including your name and the year the work 348 | was authored and/or last substantially modified. Include also a 349 | statement that the distribution and/or modification of that 350 | component is constrained by the conditions in this license. 351 | 352 | Here is an example of such a notice and statement: 353 | 354 | %% pig.dtx 355 | %% Copyright 2005 M. Y. Name 356 | % 357 | % This work may be distributed and/or modified under the 358 | % conditions of the LaTeX Project Public License, either version 1.3 359 | % of this license or (at your option) any later version. 360 | % The latest version of this license is in 361 | % http://www.latex-project.org/lppl.txt 362 | % and version 1.3 or later is part of all distributions of LaTeX 363 | % version 2005/12/01 or later. 364 | % 365 | % This work has the LPPL maintenance status `maintained'. 366 | % 367 | % The Current Maintainer of this work is M. Y. Name. 368 | % 369 | % This work consists of the files pig.dtx and pig.ins 370 | % and the derived file pig.sty. 371 | 372 | Given such a notice and statement in a file, the conditions 373 | given in this license document would apply, with the `Work' referring 374 | to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being 375 | generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' 376 | referring to any `LaTeX-Format', and both `Copyright Holder' and 377 | `Current Maintainer' referring to the person `M. Y. Name'. 378 | 379 | If you do not want the Maintenance section of LPPL to apply to your 380 | Work, change `maintained' above into `author-maintained'. 381 | However, we recommend that you use `maintained', as the Maintenance 382 | section was added in order to ensure that your Work remains useful to 383 | the community even when you can no longer maintain and support it 384 | yourself. 385 | 386 | Derived Works That Are Not Replacements 387 | --------------------------------------- 388 | 389 | Several clauses of the LPPL specify means to provide reliability and 390 | stability for the user community. They therefore concern themselves 391 | with the case that a Derived Work is intended to be used as a 392 | (compatible or incompatible) replacement of the original Work. If 393 | this is not the case (e.g., if a few lines of code are reused for a 394 | completely different task), then clauses 6b and 6d shall not apply. 395 | 396 | 397 | Important Recommendations 398 | ------------------------- 399 | 400 | Defining What Constitutes the Work 401 | 402 | The LPPL requires that distributions of the Work contain all the 403 | files of the Work. It is therefore important that you provide a 404 | way for the licensee to determine which files constitute the Work. 405 | This could, for example, be achieved by explicitly listing all the 406 | files of the Work near the copyright notice of each file or by 407 | using a line such as: 408 | 409 | % This work consists of all files listed in manifest.txt. 410 | 411 | in that place. In the absence of an unequivocal list it might be 412 | impossible for the licensee to determine what is considered by you 413 | to comprise the Work and, in such a case, the licensee would be 414 | entitled to make reasonable conjectures as to which files comprise 415 | the Work. 416 | 417 | -------------------------------------------------------------------------------- /pgflibraryqrr.shapes.heat.code.tex: -------------------------------------------------------------------------------- 1 | \pgfqkeys{/pgf}{ 2 | heat arc width/.initial=+4pt, 3 | heat arc sep/.initial=+1pt, 4 | heat arc rings/.initial=3, 5 | heat arcs/.initial=3, 6 | heat arc sep angle/.initial=20, 7 | heat opacity high/.initial=.8, 8 | heat opacity low/.initial=.2, 9 | heat rotate/.initial=90, 10 | heat/.code=\pgfqkeys{/pgf/heat}{#1}% 11 | } 12 | \pgfdeclareshape{heat} 13 | % 14 | % Draws a circle around the text 15 | % 16 | { 17 | \savedanchor\centerpoint{% 18 | \pgf@x=.5\wd\pgfnodeparttextbox% 19 | \pgf@y=.5\ht\pgfnodeparttextbox% 20 | \advance\pgf@y by-.5\dp\pgfnodeparttextbox% 21 | } 22 | 23 | \saveddimen\innerradius{% 24 | % 25 | % Caculate ``height radius'' 26 | % 27 | \pgf@ya=.5\ht\pgfnodeparttextbox% 28 | \advance\pgf@ya by.5\dp\pgfnodeparttextbox% 29 | \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/inner ysep}}% 30 | \advance\pgf@ya by\pgf@yb% 31 | % 32 | % Caculate ``width radius'' 33 | % 34 | \pgf@xa=.5\wd\pgfnodeparttextbox% 35 | \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/inner xsep}}% 36 | \advance\pgf@xa by\pgf@xb% 37 | % 38 | % Calculate length of radius vector: 39 | % 40 | \pgf@process{\pgfpointnormalised{\pgfqpoint{\pgf@xa}{\pgf@ya}}}% 41 | \ifdim\pgf@x>\pgf@y% 42 | \c@pgf@counta=\pgf@x% 43 | \ifnum\c@pgf@counta=0\relax% 44 | \else% 45 | \divide\c@pgf@counta by 255\relax% 46 | \pgf@xa=16\pgf@xa\relax% 47 | \divide\pgf@xa by\c@pgf@counta% 48 | \pgf@xa=16\pgf@xa\relax% 49 | \fi% 50 | \else% 51 | \c@pgf@counta=\pgf@y% 52 | \ifnum\c@pgf@counta=0\relax% 53 | \else% 54 | \divide\c@pgf@counta by 255\relax% 55 | \pgf@ya=16\pgf@ya\relax% 56 | \divide\pgf@ya by\c@pgf@counta% 57 | \pgf@xa=16\pgf@ya\relax% 58 | \fi% 59 | \fi% 60 | \pgf@x=\pgf@xa% 61 | % 62 | % If necessary, adjust radius so that the size requirements are 63 | % met: 64 | % 65 | \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/minimum width}}% 66 | \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/minimum height}}% 67 | \ifdim\pgf@x<.5\pgf@xb% 68 | \pgf@x=.5\pgf@xb% 69 | \fi% 70 | \ifdim\pgf@x<.5\pgf@yb% 71 | \pgf@x=.5\pgf@yb% 72 | \fi% 73 | }% 74 | 75 | \saveddimen\radius{% 76 | \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}% 77 | \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}% 78 | \ifdim\pgf@xb<\pgf@yb% 79 | \advance\pgf@x by\pgf@yb% 80 | \else% 81 | \advance\pgf@x by\pgf@xb% 82 | \fi% 83 | \pgfmathsetcount\c@pgf@counta{\pgfkeysvalueof{/pgf/heat arc rings}}% 84 | \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/heat arc width}+\pgfkeysvalueof{/pgf/heat arc sep}}% 85 | \multiply\pgf@xa\c@pgf@counta 86 | \advance\pgf@x\pgf@xa 87 | }% 88 | % 89 | % Anchors 90 | % 91 | \inheritanchor[from=circle]{north} 92 | \inheritanchor[from=circle]{north west} 93 | \inheritanchor[from=circle]{north east} 94 | \inheritanchor[from=circle]{center} 95 | \inheritanchor[from=circle]{west} 96 | \inheritanchor[from=circle]{east} 97 | \inheritanchor[from=circle]{mid} 98 | \inheritanchor[from=circle]{mid west} 99 | \inheritanchor[from=circle]{mid east} 100 | \inheritanchor[from=circle]{base} 101 | \inheritanchor[from=circle]{base west} 102 | \inheritanchor[from=circle]{base east} 103 | \inheritanchor[from=circle]{south} 104 | \inheritanchor[from=circle]{south west} 105 | \inheritanchor[from=circle]{south east} 106 | \inheritanchorborder[from=circle] 107 | % 108 | % Background path 109 | % 110 | \backgroundpath{ 111 | \pgfutil@tempdima=\innerradius% 112 | \pgfpathcircle{\centerpoint}{\pgfutil@tempdima}% 113 | }% 114 | % 115 | % 116 | % 117 | \behindbackgroundpath{% 118 | \pgfmathsetcount\c@pgf@counta{\pgfkeysvalueof{/pgf/heat arc rings}}% heat arc rings 119 | \pgfmathsetcount\c@pgf@countb{\pgfkeysvalueof{/pgf/heat arcs}}% heat arcs 120 | \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/heat arc width}}% heat arc width 121 | \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/heat arc sep}}% heat arc sep 122 | %\pgfmathsetmacro\pgf@tempa{\pgfkeysvalueof{/pgf/heat arc sep angle}}% heat arc sep angle 123 | \pgfmathsetmacro\pgf@tempb{360/\c@pgf@countb-(\pgfkeysvalueof{/pgf/heat arc sep angle})}% heat arc 124 | \pgfmathsetmacro\pgf@tempc{\pgfkeysvalueof{/pgf/heat rotate}}% heat rotate 125 | % 126 | \pgfmathsetmacro\pgf@tempd{\pgfkeysvalueof{/pgf/heat opacity high}}% heat opacity high 127 | \ifnum\c@pgf@counta=1 128 | \def\qrr@heat@opacity@seps{0}% 129 | \else 130 | \pgfmathsetmacro\qrr@heat@opacity@seps 131 | {(\pgf@tempd-(\pgfkeysvalueof{/pgf/heat opacity low}))% 132 | /(\c@pgf@counta-1)}% 133 | \fi 134 | \pgfutil@tempcnta=0 135 | \pgfutil@tempcntb=0 136 | \pgf@ya\innerradius\relax 137 | \pgftransformshift{\centerpoint} 138 | \pgfutil@loop % ring loop 139 | \advance\pgf@ya\pgf@xb % current radius + heat arc sep 140 | \pgf@yb\pgf@ya 141 | \advance\pgf@yb\pgf@xa % current radius + heat arc sep + heat arc width 142 | \pgfsetfillopacity{\pgf@tempd}% 143 | \begingroup 144 | \edef\pgf@marshal{\noexpand\pgfqkeys{/pgf/heat}{heat ring \number\numexpr\pgfutil@tempcnta+1\relax/.try}}% 145 | \pgf@marshal 146 | \tikz@options 147 | {% 148 | \pgfutil@loop 149 | \pgfmathsetmacro\qrr@start@angle{\pgf@tempc-.5*\pgf@tempb+\pgfutil@tempcntb*(360/\c@pgf@countb)}% 150 | % path 151 | \begingroup 152 | \edef\pgf@marshal{\noexpand\pgfqkeys{/pgf/heat}{heat arc \number\numexpr\pgfutil@tempcntb+1\relax/.try}% 153 | \noexpand\pgfqkeys{/pgf/heat}{heat arc \number\numexpr\pgfutil@tempcnta+1\relax-\number\numexpr\pgfutil@tempcntb+1\relax/.try}}% 154 | \pgf@marshal 155 | \tikz@options 156 | \pgfpathmoveto{\pgfpointpolar{\qrr@start@angle}{\pgf@ya}}% 157 | \pgfpatharc{\qrr@start@angle}{\qrr@start@angle+\pgf@tempb}{\pgf@ya}% 158 | \pgfpathlineto{\pgfpointpolar{\qrr@start@angle+\pgf@tempb}{\pgf@yb}}% 159 | \pgfpatharc{\qrr@start@angle+\pgf@tempb}{\qrr@start@angle}{\pgf@yb}% 160 | \pgfpathclose 161 | \pgfusepathqfill 162 | \endgroup 163 | \advance\pgfutil@tempcntb\@ne 164 | \ifnum\pgfutil@tempcntb<\c@pgf@countb 165 | \pgfutil@repeat 166 | }% 167 | \endgroup 168 | \advance\pgfutil@tempcnta\@ne 169 | \ifnum\pgfutil@tempcnta<\c@pgf@counta 170 | \pgf@ya\pgf@yb 171 | \pgfmathsetmacro\pgf@tempd{\pgf@tempd-\qrr@heat@opacity@seps}% 172 | \pgfutil@repeat 173 | \pgftransformshift{\pgfqpointscale{-1}{\centerpoint}}% 174 | } 175 | } 176 | \endinput 177 | -------------------------------------------------------------------------------- /pgflibraryqrr.shapes.openrectangle.code.tex: -------------------------------------------------------------------------------- 1 | \let\pgf@sh@openrectangle@full\pgf@sh@bg@rectangle 2 | \let\pgf@sh@openrectangle@\pgf@sh@openrectangle@full 3 | \def\pgf@sh@openrectangle@e {\pgfsetrectcap\pgfpathmoveto{\SE}\pgfpathlineto{\NE}} 4 | \def\pgf@sh@openrectangle@n {\pgfsetrectcap\pgfpathmoveto{\NW}\pgfpathlineto{\NE}} 5 | \def\pgf@sh@openrectangle@w {\pgfsetrectcap\pgfpathmoveto{\SW}\pgfpathlineto{\NW}} 6 | \def\pgf@sh@openrectangle@s {\pgfsetrectcap\pgfpathmoveto{\SW}\pgfpathlineto{\SE}} 7 | \def\pgf@sh@openrectangle@en{\pgfsetrectcap\pgfpathmoveto{\SE}\pgfpathlineto{\NE}\pgfpathlineto{\NW}} 8 | \def\pgf@sh@openrectangle@ew{\pgfsetrectcap\pgfpathmoveto{\NW}\pgfpathlineto{\SW}\pgfpathmoveto{\SE}\pgfpathlineto{\NE}} 9 | \def\pgf@sh@openrectangle@es{\pgfsetrectcap\pgfpathmoveto{\SW}\pgfpathlineto{\SE}\pgfpathlineto{\NE}} 10 | \def\pgf@sh@openrectangle@enw{\pgfsetbuttcap 11 | \pgfpathmoveto{\pgfpointadd{\SE}{\pgfpointscale{-1}{\pgfpoint{+0pt}{\pgfkeysvalueof{/pgf/outer ysep}}}}} 12 | \pgfpathlineto{\NE}\pgfpathlineto{\NW}\pgfpathlineto{\pgfpointadd{\SW}{\pgfpointscale{-1}{\pgfpoint{+0pt}{\pgfkeysvalueof{/pgf/outer ysep}}}}}} 13 | \def\pgf@sh@openrectangle@ens{\pgfsetbuttcap 14 | \pgfpathmoveto{\pgfpointadd{\SW}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{+0pt}}}} 15 | \pgfpathlineto{\SE}\pgfpathlineto{\NE}\pgfpathlineto{\pgfpointadd{\NW}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{+0pt}}}}} 16 | \def\pgf@sh@openrectangle@ews{\pgfsetbuttcap 17 | \pgfpathmoveto{\pgfpointadd{\NE}{\pgfpoint{+0pt}{\pgfkeysvalueof{/pgf/outer ysep}}}} 18 | \pgfpathlineto{\SE}\pgfpathlineto{\SW}\pgfpathlineto{\pgfpointadd{\NW}{\pgfpoint{+0pt}{\pgfkeysvalueof{/pgf/outer ysep}}}}} 19 | \def\pgf@sh@openrectangle@nw{\pgfsetrectcap\pgfpathmoveto{\NE}\pgfpathlineto{\NW}\pgfpathlineto{\SW}} 20 | \def\pgf@sh@openrectangle@ns{\pgfsetrectcap\pgfpathmoveto{\NE}\pgfpathlineto{\NW}\pgfpathmoveto{\SW}\pgfpathlineto{\SE}} 21 | \def\pgf@sh@openrectangle@nws{\pgfsetbuttcap 22 | \pgfpathmoveto{\pgfpointadd{\NE}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{+0pt}}} 23 | \pgfpathlineto{\NW}\pgfpathlineto{\SW}\pgfpathlineto{\pgfpointadd{\SE}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{+0pt}}}} 24 | \def\pgf@sh@openrectangle@ws{\pgfsetrectcap\pgfpathmoveto{\NW}\pgfpathlineto{\SW}\pgfpathlineto{\SE}} 25 | \def\pgf@sh@openrectangle@bbg@e{\pgfsetcornersarced{\pgfpointorigin}\pgfpathrectanglecorners{\southwest}{\northeast}} 26 | \let\pgf@sh@openrectangle@bbg@n\pgf@sh@openrectangle@bbg@e 27 | \let\pgf@sh@openrectangle@bbg@s\pgf@sh@openrectangle@bbg@e 28 | \let\pgf@sh@openrectangle@bbg@w\pgf@sh@openrectangle@bbg@e 29 | \let\pgf@sh@openrectangle@bbg@ns\pgf@sh@openrectangle@bbg@e 30 | \let\pgf@sh@openrectangle@bbg@ew\pgf@sh@openrectangle@bbg@e 31 | \let\pgf@sh@openrectangle@bbg@full\pgf@sh@openrectangle@full 32 | \let\pgf@sh@openrectangle@bbg@\pgf@sh@openrectangle@ 33 | \let\pgf@sh@openrectangle@bbg@enw\pgf@sh@openrectangle@enw 34 | \let\pgf@sh@openrectangle@bbg@ens\pgf@sh@openrectangle@ens 35 | \let\pgf@sh@openrectangle@bbg@ews\pgf@sh@openrectangle@ews 36 | \let\pgf@sh@openrectangle@bbg@nws\pgf@sh@openrectangle@nws 37 | \def\pgf@sh@openrectangle@bbg@en{% 38 | \pgfpathmoveto{\pgfpointadd{\SE}{\pgfpointscale{-1}{\pgfpoint{+0pt}{\pgfkeysvalueof{/pgf/outer ysep}}}}}% 39 | \pgfpathlineto{\NE}% 40 | \pgfsetcornersarced{\pgfpointorigin}% 41 | \pgfpathlineto{\pgfpointadd{\NW}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{+0pt}}}}% 42 | \pgfpathlineto{\southwest}} 43 | \def\pgf@sh@openrectangle@bbg@nw{% 44 | \pgfpathmoveto{\pgfpointadd{\NE}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{+0pt}}}% 45 | \pgfpathlineto{\NW}% 46 | \pgfsetcornersarced{\pgfpointorigin}% 47 | \pgfpathlineto{\pgfpointadd{\SW}{\pgfpointscale{-1}{\pgfpoint{+0pt}{\pgfkeysvalueof{/pgf/outer ysep}}}}}% 48 | \pgfpathlineto{\southwest\pgf@ya\pgf@y\northeast\pgf@y\pgf@ya}} 49 | \def\pgf@sh@openrectangle@bbg@ws{% 50 | \pgfpathmoveto{\pgfpointadd{\NW}{\pgfpoint{+0pt}{\pgfkeysvalueof{/pgf/outer ysep}}}}% 51 | \pgfpathlineto{\SW}% 52 | \pgfsetcornersarced{\pgfpointorigin}% 53 | \pgfpathlineto{\pgfpointadd{\SE}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{+0pt}}}% 54 | \pgfpathlineto{\northeast}} 55 | \def\pgf@sh@openrectangle@bbg@es{% 56 | \pgfpathmoveto{\pgfpointadd{\SW}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{+0pt}}}}% 57 | \pgfpathlineto{\SE}% 58 | \pgfsetcornersarced{\pgfpointorigin}% 59 | \pgfpathlineto{\pgfpointadd{\NE}{\pgfpoint{+0pt}{\pgfkeysvalueof{/pgf/outer ysep}}}}% 60 | \pgfpathlineto{\southwest\pgf@xa\pgf@x\northeast\pgf@x\pgf@xa}} 61 | \pgfset{open rectangle sides/.initial=ns, open rectangle fill/.initial=} 62 | \pgfdeclareshape{open rectangle}{% 63 | \inheritsavedanchors[from=rectangle] 64 | \inheritanchorborder[from=rectangle] 65 | \inheritanchor[from=rectangle]{north} \inheritanchor[from=rectangle]{south} 66 | \inheritanchor[from=rectangle]{north west}\inheritanchor[from=rectangle]{south west} 67 | \inheritanchor[from=rectangle]{north east}\inheritanchor[from=rectangle]{south east} 68 | \inheritanchor[from=rectangle]{center} 69 | \inheritanchor[from=rectangle]{west} \inheritanchor[from=rectangle]{east} 70 | \inheritanchor[from=rectangle]{base} \inheritanchor[from=rectangle]{mid} 71 | \inheritanchor[from=rectangle]{base west} \inheritanchor[from=rectangle]{mid west} 72 | \inheritanchor[from=rectangle]{base east} \inheritanchor[from=rectangle]{mid east} 73 | \behindbackgroundpath{% 74 | \pgfkeysgetvalue{/pgf/open rectangle fill}\pgf@temp 75 | \ifx\pgf@temp\pgfutil@empty 76 | \else 77 | \pgfextract@process\SW{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}% 78 | \pgf@xa\pgf@x\pgf@ya\pgf@y 79 | \pgfextract@process\NE{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}% 80 | \pgf@xb\pgf@x\pgf@yb\pgf@y 81 | \pgfextract@process\NW{\pgf@x\pgf@xa\pgf@y\pgf@yb}% 82 | \pgfextract@process\SE{\pgf@x\pgf@xb\pgf@y\pgf@ya}% 83 | \csname pgf@sh@openrectangle@bbg@\pgfkeysvalueof{/pgf/open rectangle sides}\endcsname 84 | \pgfsetfillcolor{\pgfkeysvalueof{/pgf/open rectangle fill}}% 85 | \pgfusepath{fill} 86 | \fi 87 | }% 88 | \backgroundpath{% 89 | \pgfextract@process\SW{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}% 90 | \pgf@xa\pgf@x\pgf@ya\pgf@y 91 | \pgfextract@process\NE{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}% 92 | \pgf@xb\pgf@x\pgf@yb\pgf@y 93 | \pgfextract@process\NW{\pgf@x\pgf@xa\pgf@y\pgf@yb}% 94 | \pgfextract@process\SE{\pgf@x\pgf@xb\pgf@y\pgf@ya}% 95 | \csname pgf@sh@openrectangle@\pgfkeysvalueof{/pgf/open rectangle sides}\endcsname}} 96 | \endinput 97 | -------------------------------------------------------------------------------- /pgflibraryqrr.shapes.roundedrectangle.code.tex: -------------------------------------------------------------------------------- 1 | \usepgflibrary{intersections}% 2 | \pgfset{ 3 | rectangle with rounded corners north west radius/.initial=6pt, 4 | rectangle with rounded corners north east radius/.initial=6pt, 5 | rectangle with rounded corners south west radius/.initial=6pt, 6 | rectangle with rounded corners south east radius/.initial=6pt, 7 | rectangle with rounded corners radius/.style={ 8 | /pgf/rectangle with rounded corners north west radius={#1}, 9 | /pgf/rectangle with rounded corners north east radius={#1}, 10 | /pgf/rectangle with rounded corners south west radius={#1}, 11 | /pgf/rectangle with rounded corners south east radius={#1}} 12 | }% 13 | \newbox\pgfnodepartlowerbox 14 | \pgfdeclareshape{split rectangle with rounded corners}{% 15 | \nodeparts{text,lower}% 16 | \savedmacro\splitrectanglewithroundedcornersparameter{% 17 | \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/inner xsep}}% 18 | \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/inner ysep}}% 19 | \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/minimum width}}% 20 | \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/minimum height}}% 21 | % 22 | \pgf@xb\wd\pgfnodeparttextbox 23 | \advance\pgf@xb\ht\pgfnodeparttextbox 24 | \advance\pgf@xb\dp\pgfnodeparttextbox 25 | \pgf@yb\wd\pgfnodepartlowerbox 26 | \advance\pgf@yb\ht\pgfnodepartlowerbox 27 | \advance\pgf@yb\dp\pgfnodepartlowerbox 28 | \ifdim\pgf@yb>\pgf@xb 29 | \pgf@x\pgf@yb 30 | \else 31 | \pgf@x\pgf@xb 32 | \fi 33 | \pgf@y\pgf@x 34 | \advance\pgf@x2\pgf@xa 35 | \advance\pgf@y2\pgf@ya 36 | \ifdim\pgf@x<\pgf@xc 37 | \pgf@x\pgf@xc 38 | \fi 39 | \ifdim\pgf@y<\pgf@yc 40 | \pgf@y\pgf@yc 41 | \fi 42 | % 43 | \pgfutil@tempdima.5\pgf@x 44 | \pgfutil@tempdimb.5\pgf@y 45 | \edef\halfWidth{\the\pgfutil@tempdima}% 46 | \edef\halfHeight{\the\pgfutil@tempdimb}% 47 | \addtosavedmacro\halfWidth 48 | \addtosavedmacro\halfHeight 49 | % 50 | \advance\pgf@x-2\pgf@xa 51 | \advance\pgf@y-2\pgf@ya 52 | % \ifdim\pgf@x<\pgf@y 53 | % \pgf@x\pgf@y 54 | % \else 55 | % \pgf@y\pgf@x 56 | % \fi 57 | \pgfutil@tempdima\pgf@x 58 | \pgfutil@tempdimb\pgf@y 59 | \pgf@y-.5\pgf@y 60 | \advance\pgf@y\ht\pgfnodeparttextbox 61 | \pgf@x.5\pgf@x 62 | \pgfextract@process\centerpoint{}% 63 | \addtosavedmacro\centerpoint 64 | % 65 | \pgf@x\pgfutil@tempdima 66 | \pgf@y\pgfutil@tempdimb 67 | \advance\pgf@x-\wd\pgfnodepartlowerbox 68 | \advance\pgf@y-\ht\pgfnodeparttextbox 69 | \advance\pgf@y-\dp\pgfnodepartlowerbox 70 | \pgf@y-\pgf@y 71 | \pgfextract@process\loweranchor{}% 72 | \addtosavedmacro\loweranchor 73 | % 74 | \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/outer xsep}}% 75 | \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/outer ysep}}% 76 | % 77 | \pgfextract@process\belownorthwest{% 78 | \pgfpointadd{\centerpoint}{\pgfqpoint{-\halfWidth}{\halfHeight}}% 79 | \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/rectangle with rounded corners north west radius}}% 80 | \advance\pgf@y-\pgfutil@tempdima 81 | \advance\pgf@x-\pgf@xb 82 | }% 83 | \addtosavedmacro\belownorthwest 84 | % 85 | \pgfextract@process\leftnortheast{% 86 | \pgfpointadd{\centerpoint}{\pgfqpoint{\halfWidth}{\halfHeight}}% 87 | \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/rectangle with rounded corners north east radius}}% 88 | \advance\pgf@x-\pgfutil@tempdima 89 | \advance\pgf@y\pgf@yb 90 | }% 91 | \addtosavedmacro\leftnortheast 92 | % 93 | \pgfextract@process\abovesoutheast{% 94 | \pgfpointadd{\centerpoint}{\pgfqpoint{\halfWidth}{-\halfHeight}}% 95 | \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/rectangle with rounded corners south east radius}}% 96 | \advance\pgf@y\pgfutil@tempdima 97 | \advance\pgf@x\pgf@xb 98 | }% 99 | \addtosavedmacro\abovesoutheast 100 | % 101 | \pgfextract@process\rightsouthwest{% 102 | \pgfpointadd{\centerpoint}{\pgfqpoint{-\halfWidth}{-\halfHeight}}% 103 | \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/rectangle with rounded corners south west radius}}% 104 | \advance\pgf@x\pgfutil@tempdima 105 | \advance\pgf@y-\pgf@yb 106 | }% 107 | \addtosavedmacro\rightsouthwest 108 | }% 109 | \anchor{lower}{\splitrectanglewithroundedcornersparameter\loweranchor} 110 | \anchor{center}{\splitrectanglewithroundedcornersparameter\centerpoint} 111 | \anchor{below north west}{\splitrectanglewithroundedcornersparameter\belownorthwest} 112 | \anchor{left north east}{\splitrectanglewithroundedcornersparameter\leftnortheast} 113 | \anchor{above south east}{\splitrectanglewithroundedcornersparameter\abovesoutheast} 114 | \anchor{right south west}{\splitrectanglewithroundedcornersparameter\rightsouthwest} 115 | \anchor{west}{\splitrectanglewithroundedcornersparameter 116 | \centerpoint\pgf@ya\pgf@y \belownorthwest\pgf@y\pgf@ya} 117 | \anchor{east}{\splitrectanglewithroundedcornersparameter 118 | \centerpoint\pgf@ya\pgf@y \abovesoutheast\pgf@y\pgf@ya} 119 | \anchor{north}{\splitrectanglewithroundedcornersparameter 120 | \centerpoint\pgf@xa\pgf@x \leftnortheast\pgf@x\pgf@xa} 121 | \anchor{south}{\splitrectanglewithroundedcornersparameter 122 | \centerpoint\pgf@xa\pgf@x \rightsouthwest\pgf@x\pgf@xa} 123 | \anchor{mid}{\splitrectanglewithroundedcornersparameter\centerpoint\pgfmathsetlength\pgf@y{+.5ex}} 124 | \anchor{mid west}{\splitrectanglewithroundedcornersparameter\belownorthwest\pgfmathsetlength\pgf@y{+.5ex}} 125 | \anchor{mid east}{\splitrectanglewithroundedcornersparameter\abovesoutheast\pgfmathsetlength\pgf@y{+.5ex}} 126 | \anchor{base}{\splitrectanglewithroundedcornersparameter\centerpoint\pgf@y0pt} 127 | \anchor{base west}{\splitrectanglewithroundedcornersparameter\belownorthwest\pgf@y0pt} 128 | \anchor{base east}{\splitrectanglewithroundedcornersparameter\abovesoutheast\pgf@y0pt} 129 | \anchor{north west}{\splitrectanglewithroundedcornersparameter 130 | \belownorthwest 131 | \pgf@xa\pgf@x 132 | \pgf@xb-\pgf@x 133 | \pgf@ya\pgf@y 134 | \leftnortheast 135 | \advance\pgf@xa\pgf@y 136 | \advance\pgf@xa-\pgf@ya 137 | \advance\pgf@xb\pgf@xa 138 | \pgfpointpolar{135}{\pgf@xb} 139 | \advance\pgf@x\pgf@xa 140 | \advance\pgf@y\pgf@ya 141 | } 142 | \anchor{south west}{\splitrectanglewithroundedcornersparameter 143 | \rightsouthwest 144 | \pgf@xa\pgf@x 145 | \pgf@ya\pgf@y 146 | \pgf@yb-\pgf@y 147 | \belownorthwest 148 | \advance\pgf@ya-\pgf@x 149 | \advance\pgf@ya\pgf@xa 150 | \advance\pgf@yb\pgf@ya 151 | \pgfpointpolar{225}{\pgf@yb} 152 | \advance\pgf@x\pgf@xa 153 | \advance\pgf@y\pgf@ya 154 | } 155 | \anchor{south east}{\splitrectanglewithroundedcornersparameter 156 | \abovesoutheast 157 | \pgf@ya\pgf@y 158 | \pgf@xb\pgf@x 159 | \pgf@xa\pgf@x 160 | \rightsouthwest 161 | \advance\pgf@xa\pgf@y 162 | \advance\pgf@xa-\pgf@ya 163 | \advance\pgf@xb-\pgf@xa 164 | \pgfpointpolar{315}{\pgf@xb} 165 | \advance\pgf@x\pgf@xa 166 | \advance\pgf@y\pgf@ya 167 | } 168 | \anchor{north east}{\splitrectanglewithroundedcornersparameter 169 | \leftnortheast 170 | \pgf@xa\pgf@x 171 | \pgf@ya\pgf@y 172 | \pgf@yb\pgf@y 173 | \abovesoutheast 174 | \advance\pgf@ya-\pgf@x 175 | \advance\pgf@ya\pgf@xa 176 | \advance\pgf@yb-\pgf@ya 177 | \pgfpointpolar{45}{\pgf@yb} 178 | \advance\pgf@x\pgf@xa 179 | \advance\pgf@y\pgf@ya 180 | } 181 | \anchor{right north west}{\splitrectanglewithroundedcornersparameter 182 | \belownorthwest\pgf@xa\pgf@x\pgf@ya\pgf@y 183 | \leftnortheast\pgf@xb\pgf@x 184 | \advance\pgf@xa\pgf@y 185 | \advance\pgf@xa-\pgf@ya 186 | \pgf@x\pgf@xa 187 | } 188 | \anchor{below north east}{\splitrectanglewithroundedcornersparameter 189 | \leftnortheast\pgf@xa\pgf@x\pgf@ya\pgf@y 190 | \abovesoutheast\pgf@yb\pgf@y 191 | \advance\pgf@ya-\pgf@x 192 | \advance\pgf@ya\pgf@xa 193 | \pgf@y\pgf@ya 194 | } 195 | \anchor{left south east}{\splitrectanglewithroundedcornersparameter 196 | \abovesoutheast\pgf@xa\pgf@x\pgf@ya\pgf@y 197 | \rightsouthwest\pgf@xb\pgf@x 198 | \advance\pgf@xa\pgf@y 199 | \advance\pgf@xa-\pgf@ya 200 | \pgf@x\pgf@xa 201 | }% 202 | \anchor{above south west}{\splitrectanglewithroundedcornersparameter 203 | \rightsouthwest\pgf@xa\pgf@x\pgf@ya\pgf@y 204 | \belownorthwest\pgf@yb\pgf@y 205 | \advance\pgf@ya-\pgf@x 206 | \advance\pgf@ya\pgf@xa 207 | \pgf@y\pgf@ya 208 | }% 209 | \backgroundpath{% 210 | \splitrectanglewithroundedcornersparameter 211 | \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/outer xsep}}% 212 | \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/outer ysep}}% 213 | \pgfpathmoveto{\pgfpointadd{\belownorthwest}{\pgfqpoint{\pgf@xb}{+0pt}}}% 214 | \pgfpathlineto{\pgfpointadd{\pgf@sh@reanchor{split rectangle with rounded corners}{above south west}}{\pgfqpoint{\pgf@xb}{+0pt}}}% 215 | \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/rectangle with rounded corners south west radius}}% 216 | \pgfpatharcto{\pgfutil@tempdima}{\pgfutil@tempdima}{0}{0}{1}{\pgfpointadd{\rightsouthwest}{\pgfqpoint{+0pt}{\pgf@yb}}}% 217 | \pgfpathlineto{\pgfpointadd{\pgf@sh@reanchor{split rectangle with rounded corners}{left south east}}{\pgfqpoint{+0pt}{\pgf@yb}}}% 218 | \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/rectangle with rounded corners south east radius}}% 219 | \pgfpatharcto{\pgfutil@tempdima}{\pgfutil@tempdima}{0}{0}{1}{\pgfpointadd{\abovesoutheast}{\pgfqpoint{-\pgf@xb}{+0pt}}}% 220 | \pgfpathlineto{\pgfpointadd{\pgf@sh@reanchor{split rectangle with rounded corners}{below north east}}{\pgfqpoint{-\pgf@xb}{+0pt}}}% 221 | \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/rectangle with rounded corners north east radius}}% 222 | \pgfpatharcto{\pgfutil@tempdima}{\pgfutil@tempdima}{0}{0}{1}{\pgfpointadd{\leftnortheast}{\pgfqpoint{+0pt}{-\pgf@yb}}}% 223 | \pgfpathlineto{\pgfpointadd{\pgf@sh@reanchor{split rectangle with rounded corners}{right north west}}{\pgfqpoint{+0pt}{-\pgf@yb}}}% 224 | \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/rectangle with rounded corners north west radius}}% 225 | \pgfpatharcto{\pgfutil@tempdima}{\pgfutil@tempdima}{0}{0}{1}{\pgfpointadd{\belownorthwest}{\pgfqpoint{\pgf@xb}{+0pt}}}% 226 | \pgfpathclose 227 | \loweranchor 228 | \pgf@xa\pgf@x 229 | \advance\pgf@y-\dp\pgfnodepartlowerbox 230 | \pgfpathmoveto{\pgfqpoint{+0pt}{\pgf@y}}% 231 | \advance\pgf@xa\wd\pgfnodepartlowerbox 232 | \pgfpathlineto{\pgfqpoint{\pgf@xa}{\ht\pgfnodeparttextbox}}% 233 | }% 234 | \anchorborder{% 235 | \pgf@xb=\pgf@x 236 | \pgf@yb=\pgf@y 237 | \pgf@process{\pgf@sh@reanchor{split rectangle with rounded corners}{south}}% 238 | \pgf@ya\pgf@y 239 | \pgf@process{\pgf@sh@reanchor{split rectangle with rounded corners}{west}}% 240 | \pgf@xa\pgf@x 241 | \pgf@process{\pgf@sh@reanchor{split rectangle with rounded corners}{north}}% 242 | \pgf@yc\pgf@y 243 | \pgf@process{\pgf@sh@reanchor{split rectangle with rounded corners}{east}}% 244 | \pgf@y\pgf@yc 245 | \advance\pgf@x by-\pgf@xa% 246 | \advance\pgf@y by-\pgf@ya% 247 | \pgf@xc=.5\pgf@x% x/y is half width/height 248 | \pgf@yc=.5\pgf@y% 249 | \advance\pgf@xa by\pgf@xc% xa/ya becomes center 250 | \advance\pgf@ya by\pgf@yc% 251 | \edef\pgf@marshal{% 252 | \noexpand\pgfpointborderrectangle 253 | {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}} 254 | {\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}% 255 | }% 256 | \pgf@process{\pgf@marshal}% 257 | \advance\pgf@xa by\pgf@x% 258 | \advance\pgf@ya by\pgf@y% 259 | % 260 | \pgfutil@tempdima\pgf@xa 261 | \pgfutil@tempdimb\pgf@ya 262 | % \pgf@x\pgf@xa 263 | % \pgf@y\pgf@ya 264 | \splitrectanglewithroundedcornersparameter 265 | \centerpoint 266 | \pgf@xc\pgf@x 267 | \pgf@yc\pgf@y 268 | \ifdim\pgfutil@tempdima>\pgf@xc 269 | \ifdim\pgfutil@tempdimb>\pgf@yc % north east 270 | \pgf@lib@sh@qrr@get@radius@and@center0\pgfutil@tempdima\pgfutil@tempdimb 271 | \else % south east 272 | \pgf@lib@sh@qrr@get@radius@and@center3\pgfutil@tempdima\pgfutil@tempdimb 273 | \fi 274 | \else 275 | \ifdim\pgfutil@tempdimb>\pgf@yc % north west 276 | \pgf@lib@sh@qrr@get@radius@and@center1\pgfutil@tempdima\pgfutil@tempdimb 277 | \else % south west 278 | \pgf@lib@sh@qrr@get@radius@and@center2\pgfutil@tempdima\pgfutil@tempdimb 279 | \fi 280 | \fi 281 | } 282 | } 283 | \def\pgf@lib@sh@qrr@get@radius@and@center#1#2#3{% 284 | \begingroup 285 | \pgfutil@tempswafalse 286 | \ifcase#1% north east 287 | \def\pgf@tempa{1}% 288 | \leftnortheast 289 | \pgf@xa\pgf@x 290 | \pgf@ya\pgf@y 291 | \pgf@yb\pgf@y 292 | \abovesoutheast 293 | \advance\pgf@ya-\pgf@x 294 | \advance\pgf@ya\pgf@xa 295 | \advance\pgf@yb-\pgf@ya 296 | \ifdim#3>\pgf@ya 297 | \ifdim#2>\pgf@xa 298 | \pgfutil@tempswatrue 299 | \fi 300 | \fi 301 | \or % north west 302 | \def\pgf@tempa{1}% 303 | \belownorthwest 304 | \pgf@xa\pgf@x 305 | \pgf@yb-\pgf@x 306 | \pgf@ya\pgf@y 307 | \leftnortheast 308 | \advance\pgf@xa\pgf@y 309 | \advance\pgf@xa-\pgf@ya 310 | \advance\pgf@yb\pgf@xa 311 | \ifdim#3>\pgf@ya 312 | \ifdim#2<\pgf@xa 313 | \pgfutil@tempswatrue 314 | \fi 315 | \fi 316 | \or % south west 317 | \def\pgf@tempa{2}% 318 | \rightsouthwest 319 | \pgf@xa\pgf@x 320 | \pgf@ya\pgf@y 321 | \pgf@yb-\pgf@y 322 | \belownorthwest 323 | \advance\pgf@ya-\pgf@x 324 | \advance\pgf@ya\pgf@xa 325 | \advance\pgf@yb\pgf@ya 326 | \ifdim#3<\pgf@ya 327 | \ifdim#2<\pgf@xa 328 | \pgfutil@tempswatrue 329 | \fi 330 | \fi 331 | \else % south east 332 | \def\pgf@tempa{2}% 333 | \abovesoutheast 334 | \pgf@ya\pgf@y 335 | \pgf@yb\pgf@x 336 | \pgf@xa\pgf@x 337 | \rightsouthwest 338 | \advance\pgf@xa\pgf@y 339 | \advance\pgf@xa-\pgf@ya 340 | \advance\pgf@yb-\pgf@xa 341 | \ifdim#3<\pgf@ya 342 | \ifdim#2>\pgf@xa 343 | \pgfutil@tempswatrue 344 | \fi 345 | \fi 346 | \fi 347 | \pgfinterruptboundingbox 348 | \ifpgfutil@tempswa 349 | \pgfintersectionofpaths{ 350 | \pgfpathmoveto{\pgfqpoint{\pgf@xc}{\pgf@yc}}% 351 | \pgfpathlineto{\pgfqpoint{#2}{#3}}% 352 | }{% 353 | \pgfpathcircle{\pgfqpoint{\pgf@xa}{\pgf@ya}}{\pgf@yb}% 354 | }% 355 | \pgfpointintersectionsolution{\pgf@tempa} 356 | \pgftransforminvert 357 | \pgfpointtransformed{}% 358 | \else 359 | \pgf@process{\pgfqpoint{#2}{#3}}% 360 | \fi 361 | \endpgfinterruptboundingbox 362 | \endgroup 363 | } 364 | \endinput 365 | -------------------------------------------------------------------------------- /pgflibraryqrr.shapes.roundedrectangle2.code.tex: -------------------------------------------------------------------------------- 1 | \pgfset{ 2 | rectangle with rounded corners radius/.initial=4pt, 3 | rectangle with rounded corners mode/.initial={i} 4 | } 5 | \def\pgf@lib@sh@rwrc@options@#1#2#3#4#5#6#7{% 6 | \edef\pgf@lib@sh@rwrc@options@R{\csname rwrcpR#1\endcsname}% 7 | \edef\pgf@lib@sh@rwrc@options@M{\csname rwrcpM#1\endcsname}% 8 | \def\pgf@lib@sh@rwrc@options@A{\pgfpointadd{\csname pgf@anchor@rectangle with rounded corners@#2\endcsname}{\pgfpoint{#4\outerxsep}{#5\outerysep}}}% 9 | \def\pgf@lib@sh@rwrc@options@B{\pgfpointadd{\csname pgf@anchor@rectangle with rounded corners@#3\endcsname}{\pgfpoint{#6\outerxsep}{#7\outerysep}}}% 10 | } 11 | \def\pgf@lib@sh@rwrc@options#1{% 12 | \expandafter\pgf@lib@sh@rwrc@options@ 13 | \ifcase#1??????\or{ne}{north east}{north}--{0*}-\or 14 | {nw}{north west}{west}+-+{0*}\or 15 | {sw}{south west}{south}++{0*}+\or 16 | {se}{south east}{east}-+-{0*}\or 17 | ??????\fi} 18 | 19 | \def\pgfutil@firstofmany#1#2\pgf@stop{#1} 20 | 21 | \def\pgf@lib@sh@rwrc@r#1,#2,#3,#4,#5\pgf@stop{% 22 | \pgfmathsetlengthmacro\rwrcpRne{#1}% 23 | \edef\pgf@temp{#2}% 24 | \ifx\pgf@temp\pgfutil@empty 25 | \let\rwrcpRnw\rwrcpRne 26 | \else 27 | \pgfmathsetlengthmacro\rwrcpRnw{#2}% 28 | \fi 29 | \edef\pgf@temp{#3}% 30 | \ifx\pgf@temp\pgfutil@empty 31 | \let\rwrcpRsw\rwrcpRnw 32 | \else 33 | \pgfmathsetlengthmacro\rwrcpRsw{#3}% 34 | \fi 35 | \edef\pgf@temp{#4}% 36 | \ifx\pgf@temp\pgfutil@empty 37 | \let\rwrcpRse\rwrcpRsw 38 | \else 39 | \pgfmathsetlengthmacro\rwrcpRse{#4}% 40 | \fi 41 | } 42 | \def\pgf@lib@sh@rwrc@m#1,#2,#3,#4,#5\pgf@stop{% 43 | \edef\rwrcpMne{#1}% 44 | \edef\pgf@temp{#2}% 45 | \ifx\pgf@temp\pgfutil@empty 46 | \let\rwrcpMnw\rwrcpMne 47 | \else 48 | \let\rwrcpMnw\pgf@temp 49 | \fi 50 | \edef\pgf@temp{#3}% 51 | \ifx\pgf@temp\pgfutil@empty 52 | \let\rwrcpMsw\rwrcpMnw 53 | \else 54 | \let\rwrcpMsw\pgf@temp 55 | \fi 56 | \edef\pgf@temp{#4}% 57 | \ifx\pgf@temp\pgfutil@empty 58 | \let\rwrcpMse\rwrcpMsw 59 | \else 60 | \let\rwrcpMse\pgf@temp% 61 | \fi 62 | } 63 | \pgfdeclareshape{rectangle with rounded corners}{% 64 | \savedmacro\rectangleWithRoundedCornersParameters{ 65 | \pgfkeysgetvalue{/pgf/rectangle with rounded corners radius}\pgf@temp 66 | \expandafter\pgf@lib@sh@rwrc@r\pgf@temp,,,,\pgf@stop 67 | \pgfkeysgetvalue{/pgf/rectangle with rounded corners mode}\pgf@temp 68 | \expandafter\pgf@lib@sh@rwrc@m\pgf@temp,,,,\pgf@stop 69 | % 70 | \addtosavedmacro\rwrcpRne 71 | \addtosavedmacro\rwrcpRnw 72 | \addtosavedmacro\rwrcpRsw 73 | \addtosavedmacro\rwrcpRse 74 | \addtosavedmacro\rwrcpMne 75 | \addtosavedmacro\rwrcpMnw 76 | \addtosavedmacro\rwrcpMsw 77 | \addtosavedmacro\rwrcpMse 78 | % 79 | \pgfutil@tempdima.5\pgflinewidth 80 | \edef\halflinewidth{\the\pgfutil@tempdima}% 81 | \addtosavedmacro\halflinewidth 82 | % 83 | \pgf@x=\wd\pgfnodeparttextbox% 84 | \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/inner xsep}}% 85 | \advance\pgf@x by 2\pgf@xc% 86 | \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}% 87 | \ifdim\pgf@x>\pgf@xb% 88 | \pgf@xb=\pgf@x% 89 | \fi% 90 | % 91 | \pgf@y=\ht\pgfnodeparttextbox% 92 | \advance\pgf@y by\dp\pgfnodeparttextbox% 93 | \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/inner ysep}}% 94 | \advance\pgf@y by 2\pgf@yc% 95 | \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}% 96 | \ifdim\pgf@y>\pgf@yb% 97 | \pgf@yb=\pgf@y% 98 | \fi% 99 | % 100 | \pgfextract@process\northeast{% 101 | \pgf@y\pgf@yb 102 | \pgf@x\pgf@xb 103 | % 104 | \pgf@x=.5\pgf@x% 105 | \advance\pgf@x by.5\wd\pgfnodeparttextbox% 106 | \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}% 107 | \advance\pgf@x by\pgf@xa% 108 | % 109 | \pgf@y=.5\pgf@y% 110 | \advance\pgf@y by-.5\dp\pgfnodeparttextbox% 111 | \advance\pgf@y by.5\ht\pgfnodeparttextbox% 112 | \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}% 113 | \advance\pgf@y by\pgf@ya% 114 | } 115 | \addtosavedmacro\northeast 116 | % 117 | \pgfextract@process\southwest{% 118 | \pgf@y\pgf@yb 119 | \pgf@x\pgf@xb 120 | % 121 | \pgf@x=-.5\pgf@x% 122 | \advance\pgf@x by.5\wd\pgfnodeparttextbox% 123 | \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}% 124 | \advance\pgf@x by-\pgf@xa% 125 | % 126 | \pgf@y=-.5\pgf@y% 127 | \advance\pgf@y by-.5\dp\pgfnodeparttextbox% 128 | \advance\pgf@y by.5\ht\pgfnodeparttextbox% 129 | \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}% 130 | \advance\pgf@y by-\pgf@ya% 131 | } 132 | \addtosavedmacro\southwest 133 | } 134 | \anchor{center}{ 135 | \rectangleWithRoundedCornersParameters 136 | \pgf@process{\northeast}% 137 | \pgf@xa=.5\pgf@x% 138 | \pgf@ya=.5\pgf@y% 139 | \pgf@process{\southwest}% 140 | \pgf@x=.5\pgf@x% 141 | \pgf@y=.5\pgf@y% 142 | \advance\pgf@x by \pgf@xa% 143 | \advance\pgf@y by \pgf@ya% 144 | } 145 | \anchor{mid}{\csname pgf@anchor@rectangle with rounded corners@center\endcsname\pgf@y=.5ex } 146 | \anchor{base}{\csname pgf@anchor@rectangle with rounded corners@center\endcsname\pgf@y=0pt } 147 | \anchor{north}{% 148 | \rectangleWithRoundedCornersParameters 149 | \pgf@process{\southwest}% 150 | \pgf@xa=.5\pgf@x% 151 | \pgf@process{\northeast}% 152 | \pgf@x=.5\pgf@x% 153 | \advance\pgf@x by \pgf@xa% 154 | } 155 | \anchor{south}{% 156 | \rectangleWithRoundedCornersParameters 157 | \pgf@process{\northeast}% 158 | \pgf@xa=.5\pgf@x% 159 | \pgf@process{\southwest}% 160 | \pgf@x=.5\pgf@x% 161 | \advance\pgf@x by \pgf@xa% 162 | } 163 | \anchor{west}{% 164 | \rectangleWithRoundedCornersParameters 165 | \pgf@process{\northeast}% 166 | \pgf@ya=.5\pgf@y% 167 | \pgf@process{\southwest}% 168 | \pgf@y=.5\pgf@y% 169 | \advance\pgf@y by \pgf@ya% 170 | } 171 | \anchor{mid west}{\rectangleWithRoundedCornersParameters\southwest\pgf@y=.5ex } 172 | \anchor{base west}{\rectangleWithRoundedCornersParameters\southwest\pgf@y=0pt } 173 | \anchor{north west}{ 174 | \rectangleWithRoundedCornersParameters 175 | \southwest 176 | \pgf@xa=\pgf@x 177 | \northeast 178 | \pgf@x=\pgf@xa} 179 | \anchor{south west}{\rectangleWithRoundedCornersParameters\southwest} 180 | \anchor{east}{% 181 | \rectangleWithRoundedCornersParameters 182 | \pgf@process{\southwest}% 183 | \pgf@ya=.5\pgf@y% 184 | \pgf@process{\northeast}% 185 | \pgf@y=.5\pgf@y% 186 | \advance\pgf@y by \pgf@ya% 187 | } 188 | \anchor{mid east}{\rectangleWithRoundedCornersParameters\northeast\pgf@y=.5ex } 189 | \anchor{base east}{\rectangleWithRoundedCornersParameters\northeast\pgf@y=0pt } 190 | \anchor{north east}{\rectangleWithRoundedCornersParameters\northeast} 191 | \anchor{south east}{ 192 | \rectangleWithRoundedCornersParameters 193 | \northeast 194 | \pgf@xa=\pgf@x 195 | \southwest 196 | \pgf@x=\pgf@xa 197 | } 198 | \backgroundpath{% 199 | \rectangleWithRoundedCornersParameters 200 | \pgfmathsetlengthmacro\outerxsep{\pgfkeysvalueof{/pgf/outer xsep}}% 201 | \pgfmathsetlengthmacro\outerysep{\pgfkeysvalueof{/pgf/outer ysep}}% 202 | \pgfpathmoveto{\pgfpointadd{\csname pgf@anchor@rectangle with rounded corners@east\endcsname}{\pgfqpoint{-\outerxsep}{0pt}}}% 203 | \pgfmathloop 204 | \ifnum\pgfmathcounter>4\relax 205 | \pgfpathclose 206 | \else 207 | \pgf@lib@sh@rwrc@options\pgfmathcounter% 208 | \pgfsetcornersarced{\pgfqpoint{\pgf@lib@sh@rwrc@options@R}{\pgf@lib@sh@rwrc@options@R}}% 209 | \if o\pgf@lib@sh@rwrc@options@M 210 | \pgfsetcornersarced{\pgfqpoint{-\pgf@lib@sh@rwrc@options@R}{-\pgf@lib@sh@rwrc@options@R}}% 211 | \edef\pgf@lib@sh@rwrc@options@R{-\pgf@lib@sh@rwrc@options@R}% 212 | \def\pgf@lib@sh@rwrc@options@M{i}% 213 | \fi % 214 | \if i\pgf@lib@sh@rwrc@options@M 215 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@A}% 216 | \else\if h\pgf@lib@sh@rwrc@options@M 217 | \ifcase\pgfmathcounter 218 | \or % ne 219 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@A}% 220 | \pgfpathlineto{\pgfpointadd{\pgf@lib@sh@rwrc@options@A}{\pgfqpoint{\pgf@lib@sh@rwrc@options@R}{0pt}}} 221 | \or % nw 222 | \pgfpathlineto{\pgfpointadd{\pgf@lib@sh@rwrc@options@A}{\pgfqpoint{-\pgf@lib@sh@rwrc@options@R}{0pt}}} 223 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@A}% 224 | \or % sw 225 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@A}% 226 | \pgfpathlineto{\pgfpointadd{\pgf@lib@sh@rwrc@options@A}{\pgfqpoint{-\pgf@lib@sh@rwrc@options@R}{0pt}}} 227 | \or % se 228 | \pgfpathlineto{\pgfpointadd{\pgf@lib@sh@rwrc@options@A}{\pgfqpoint{\pgf@lib@sh@rwrc@options@R}{0pt}}} 229 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@A}% 230 | \fi 231 | \else\if v\pgf@lib@sh@rwrc@options@M 232 | \ifcase\pgfmathcounter 233 | \or % ne 234 | \pgfpathlineto{\pgfpointadd{\pgf@lib@sh@rwrc@options@A}{\pgfqpoint{0pt}{\pgf@lib@sh@rwrc@options@R}}} 235 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@A}% 236 | \or % nw 237 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@A}% 238 | \pgfpathlineto{\pgfpointadd{\pgf@lib@sh@rwrc@options@A}{\pgfqpoint{0pt}{\pgf@lib@sh@rwrc@options@R}}} 239 | \or % sw 240 | \pgfpathlineto{\pgfpointadd{\pgf@lib@sh@rwrc@options@A}{\pgfqpoint{0pt}{-\pgf@lib@sh@rwrc@options@R}}} 241 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@A}% 242 | \or % se 243 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@A}% 244 | \pgfpathlineto{\pgfpointadd{\pgf@lib@sh@rwrc@options@A}{\pgfqpoint{0pt}{-\pgf@lib@sh@rwrc@options@R}}} 245 | \fi 246 | \else 247 | \pgfsetcornersarced{\pgfpointorigin}% 248 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@A}% 249 | \fi 250 | \fi 251 | \fi 252 | % 253 | \pgfpathlineto{\pgf@lib@sh@rwrc@options@B}% 254 | \repeatpgfmathloop 255 | } 256 | } 257 | \begingroup 258 | \expandafter\def\expandafter\pgf@temp\expandafter{\expandafter\gdef\csname pgf@anchor@rectangle with rounded corners@border\endcsname##1} 259 | \expandafter\pgf@temp\expandafter{\expandafter\rectangleWithRoundedCornersParameters\pgf@anchor@rectangle@border{#1}} 260 | \endgroup -------------------------------------------------------------------------------- /tikzlibraryarcs.code.tex: -------------------------------------------------------------------------------- 1 | \let\tikz@arc@moveto\relax 2 | \let\tikz@arc@center\pgfutil@empty 3 | \let\tikz@arc@from\pgfutil@empty 4 | \let\tikz@arc@to\pgfutil@empty 5 | \def\tikz@arc@movetolineto#1{% 6 | \def\tikz@arc@moveto{\tikz@@@parse@polar{\tikz@arc@@movetolineto#1}(\tikz@s:\pgfkeysvalueof{/tikz/x radius} and \pgfkeysvalueof{/tikz/y radius})}} 7 | \def\tikz@arc@@movetolineto#1#2{#1{\pgfpointadd{#2}{\tikz@last@position@saved}}} 8 | \tikzset{% 9 | move to start/.code=\tikz@arc@movetolineto\pgfpathmoveto,% 10 | line to start/.code=\tikz@arc@movetolineto\pgfpathlineto, 11 | arc center/.style={ 12 | move to start, 13 | /utils/exec=\edef\tikz@arc@center{#1}}, 14 | arc from/.code=\def\tikz@arc@from{#1}, 15 | arc to/.code=\def\tikz@arc@to{#1}, 16 | } 17 | 18 | \def\tikz@arc@opt[#1]{% over-write! 19 | {% 20 | \tikzset{every arc/.try,#1}% 21 | \pgfkeysgetvalue{/tikz/start angle}\tikz@s 22 | \pgfkeysgetvalue{/tikz/end angle}\tikz@e 23 | \pgfkeysgetvalue{/tikz/delta angle}\tikz@d 24 | \ifx\tikz@arc@center\pgfutil@empty 25 | \ifx\tikz@arc@from\pgfutil@empty 26 | \ifx\tikz@arc@to\pgfutil@empty 27 | % okay 28 | \else % \tikz@last@position@saved 29 | \tikz@scan@one@point\pgfutil@firstofone(\tikz@arc@to)\relax 30 | % \tikz@scan@one@point{\pgfpointdiff{\tikz@last@position@saved}}(\tikz@arc@to) 31 | % \csname pgfmathatan2\endcsname{-\pgf@x}{-\pgf@y}% 32 | % \let\tikz@e\pgfmathresult 33 | \fi 34 | \else 35 | \fi 36 | \else 37 | \fi 38 | % 39 | \ifx\tikz@s\pgfutil@empty% 40 | \pgfmathsetmacro\tikz@s{\tikz@e-\tikz@d} 41 | \else 42 | \ifx\tikz@e\pgfutil@empty% 43 | \pgfmathsetmacro\tikz@e{\tikz@s+\tikz@d} 44 | \fi% 45 | \fi 46 | \tikz@arc@moveto 47 | \tikz@do@arc{\tikz@s}{\tikz@e} 48 | {\pgfkeysvalueof{/tikz/x radius}} 49 | {\pgfkeysvalueof{/tikz/y radius}} 50 | }% 51 | \tikz@arcfinal% 52 | } -------------------------------------------------------------------------------- /tikzlibrarynorm.code.tex: -------------------------------------------------------------------------------- 1 | \tikzset{ 2 | Norm/.code={% 3 | \pgfmathparse{#1}% 4 | \edef\qrr@tikz@norm{\pgfmathresult\ifpgfmathunitsdeclared pt\fi}% 5 | \let\ifqrr@tikz@normcs@unitsdeclared\ifpgfmathunitsdeclared}, 6 | Norm=1, 7 | norm/.style={to path={-- ++(norm cs: \tikztotarget\space from \tikztostart) \tikztonodes}} 8 | } 9 | \newif\ifqrr@tikz@normcs@unitsdeclared 10 | \newdimen\qrr@pgf@normcs@from@x\newdimen\qrr@pgf@normcs@from@y 11 | \tikzdeclarecoordinatesystem{norm}{% 12 | \begingroup 13 | \let\qrr@next\relax 14 | \pgfutil@in@{ for }{#1}% 15 | \ifpgfutil@in@ 16 | \qrr@tikz@normcs@parse@for#1\@qrr@tikz@normcs@parse@for 17 | \else 18 | \def\pgf@tempa{#1}% 19 | \fi 20 | \edef\pgf@marshal{\noexpand\pgfutil@in@{ from }{\pgf@tempa}}\pgf@marshal 21 | \ifpgfutil@in@ 22 | \expandafter\qrr@tikz@normcs@parse@from\pgf@tempa\@qrr@tikz@normcs@parse@from 23 | \let\qrr@next\qrr@tikz@normcs@calc@hard 24 | \else 25 | \let\qrr@tikz@normcs@parse@to\pgf@tempa 26 | \qrr@pgf@normcs@from@x\z@ 27 | \qrr@pgf@normcs@from@y\z@ 28 | \fi 29 | \expandafter\qrr@tikz@normcs@parse@@to\expandafter{\qrr@tikz@normcs@parse@to}% 30 | } 31 | \def\qrr@tikz@normcs@calc@easy#1{% 32 | \pgf@xx\@ne 33 | \pgf@yy\@ne 34 | \pgf@xy\z@ 35 | \pgf@yx\z@ 36 | \tikz@scan@one@point\pgfutil@firstofone(#1)\relax 37 | \pgf@xa\pgf@x\pgf@ya\pgf@y 38 | } 39 | \def\qrr@tikz@normcs@calc@hard#1{% 40 | \tikz@scan@one@point\pgfutil@firstofone(#1)\relax 41 | \pgf@xa\pgf@x\pgf@ya\pgf@y 42 | \advance\pgf@xa-\qrr@pgf@normcs@from@x 43 | \advance\pgf@ya-\qrr@pgf@normcs@from@y 44 | \pgfpointnormalised{\pgfqpoint{\pgf@xa}{\pgf@ya}} 45 | \pgfmathsetlength\pgf@xa{\pgf@yy*\pgf@x-\pgf@yx*\pgf@y} 46 | \pgfmathsetlength\pgf@ya{-\pgf@xy*\pgf@x+\pgf@xx*\pgf@y} 47 | } 48 | \def\qrr@tikz@normcs@calc@unit#1{% 49 | \tikz@scan@one@point\pgfutil@firstofone(#1)\relax 50 | \pgf@xa\pgf@x\pgf@ya\pgf@y 51 | \advance\pgf@xa-\qrr@pgf@normcs@from@x 52 | \advance\pgf@ya-\qrr@pgf@normcs@from@y 53 | \pgfpointnormalised{\pgfqpoint{\pgf@xa}{\pgf@ya}} 54 | \pgf@xa\pgf@x\pgf@ya\pgf@y 55 | } 56 | \def\qrr@tikz@normcs@parse@@to#1{% 57 | \ifqrr@tikz@normcs@unitsdeclared 58 | \let\qrr@next\qrr@tikz@normcs@calc@unit 59 | \else 60 | \ifx\qrr@next\relax 61 | \pgfutil@in@{cs:}{#1}% 62 | \ifpgfutil@in@ 63 | \let\qrr@next\qrr@tikz@normcs@calc@hard 64 | \else 65 | \pgfutil@in@{intersection }{#1}% 66 | \ifpgfutil@in@ 67 | \let\qrr@next\qrr@tikz@normcs@calc@hard 68 | \else 69 | \pgfutil@in@|{#1}% 70 | \ifpgfutil@in@ 71 | \let\qrr@next\qrr@tikz@normcs@calc@hard 72 | \else 73 | \pgfutil@in@:{#1}% 74 | \ifpgfutil@in@ 75 | \let\qrr@next\qrr@tikz@normcs@calc@easy 76 | \else 77 | \pgfutil@in@,{#1}% 78 | \ifpgfutil@in@ 79 | \let\qrr@next\qrr@tikz@normcs@calc@easy 80 | \else 81 | \let\qrr@next\qrr@tikz@normcs@calc@hard 82 | \fi 83 | \fi 84 | \fi 85 | \fi 86 | \fi 87 | \fi 88 | \fi 89 | \qrr@next{#1}% 90 | \pgfmathatantwo{+\pgf@xa}{+\pgf@ya}% 91 | \ifqrr@tikz@normcs@unitsdeclared 92 | \edef\pgf@marshal{\noexpand\pgfpointpolar{\pgfmathresult}{\qrr@tikz@norm}} 93 | \else 94 | \edef\pgf@marshal{\noexpand\pgfpointpolarxy{\pgfmathresult}{\qrr@tikz@norm}} 95 | \fi 96 | \pgfmath@smuggleone\pgf@marshal 97 | \endgroup 98 | \pgf@marshal 99 | 100 | } 101 | 102 | \def\qrr@tikz@normcs@parse@from#1 from #2\@qrr@tikz@normcs@parse@from{% 103 | \def\qrr@tikz@normcs@parse@to{#1}% 104 | \tikz@scan@one@point\pgfutil@firstofone(#2)\relax 105 | \qrr@pgf@normcs@from@x\pgf@x 106 | \qrr@pgf@normcs@from@y\pgf@y 107 | } 108 | \def\qrr@tikz@normcs@parse@for#1 for #2\@qrr@tikz@normcs@parse@for{% 109 | \def\pgf@tempa{#1}% 110 | \pgfkeysalso{/tikz/Norm={#2}}% 111 | } 112 | 113 | % a fix for the 2.10 version of PGF/TikZ 114 | \expandafter\let\expandafter\pgfmathatantwo\csname pgfmathatan2\endcsname 115 | -------------------------------------------------------------------------------- /tikzlibraryqrr.arc.code.tex: -------------------------------------------------------------------------------- 1 | \tikzset{ 2 | arc/ccw/.initial=1, 3 | arc/large/.initial=0, 4 | arc ccw/.style={/tikz/arc/ccw=1}, 5 | arc cw/.style={/tikz/arc/ccw=0}, 6 | arc large/.style={/tikz/arc/large=1}, 7 | arc small/.style={/tikz/arc/large=0}, 8 | arc rotation/.initial=0 9 | } 10 | \def\pgf@temp{2.10-cvs} 11 | \ifx\pgfversion\pgf@temp\else 12 | \let\tikz@timer@arc\tikz@timer@line 13 | \fi 14 | \def\tikz@arcA rc{\pgfutil@ifnextchar t% 15 | {\tikz@flush@moveto\expandafter\expandafter\expandafter\tikz@arcB@cont\expandafter\pgfutil@gobble\pgfutil@gobble} 16 | {\tikz@flush@moveto\tikz@arc@cont}} 17 | \def\tikz@arcB@cont{% 18 | \pgfutil@ifnextchar[\tikz@@do@arcB{ 19 | \advance\tikz@expandcount by -10\relax% go down quickly 20 | \ifnum\tikz@expandcount<0\relax% 21 | \def\@next{\tikz@@do@arcB[]}% 22 | \else% 23 | \def\@next{\expandafter\tikz@arcB@cont}% 24 | \fi% 25 | \@next}}% 26 | \def\tikz@@do@arcB[#1]{% 27 | \def\tikz@arcB@options{#1}% 28 | \tikz@do@@arcB} 29 | \def\tikz@do@@arcB{% 30 | \pgfutil@ifnextchar n{\tikz@collect@label@onpath\tikz@do@@arcB} 31 | {\pgfutil@ifnextchar c{\tikz@collect@coordinate@onpath\tikz@do@@arcB} 32 | {\tikz@scan@one@point\tikz@do@arcB}}} 33 | 34 | \def\tikz@do@arcB#1{% 35 | \edef\tikz@timer@start{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}} 36 | \tikz@make@last@position{#1}% 37 | \edef\tikz@timer@end{\noexpand\pgfqpoint{\the\tikz@lastx}{\the\tikz@lasty}}% 38 | \iftikz@shapeborder 39 | \edef\tikz@moveto@waiting{\tikz@shapeborder@name}% 40 | \fi 41 | \begingroup 42 | \tikzset{every arc/.try}% 43 | \expandafter\tikzset\expandafter{\tikz@arcB@options}% 44 | \pgfmathparse{\pgfkeysvalueof{/tikz/x radius}}% 45 | \let\tikz@arc@x\pgfmathresult 46 | \ifpgfmathunitsdeclared 47 | \pgfmathparse{\pgfkeysvalueof{/tikz/y radius}}% 48 | \let\tikz@arc@y\pgfmathresult 49 | \ifpgfmathunitsdeclared 50 | \edef\tikz@arc@x{\tikz@arc@x pt}% 51 | \edef\tikz@arc@y{\tikz@arc@y pt}% 52 | \pgfpatharcto{\tikz@arc@x}{\tikz@arc@y} 53 | {\pgfkeysvalueof{/tikz/arc rotation}}{\pgfkeysvalueof{/tikz/arc/large}} 54 | {\pgfkeysvalueof{/tikz/arc/ccw}}{#1}% 55 | \else 56 | \tikzerror{You cannot mix dimensions and dimension values in an arc}% 57 | \fi 58 | \else 59 | \pgfmathparse{\pgfkeysvalueof{/tikz/y radius}}% 60 | \let\tikz@arc@y\pgfmathresult 61 | \ifpgfmathunitsdeclared 62 | \tikzerror{You cannot mix dimensions and dimension values in an arc}% 63 | \else 64 | \pgf@process{\pgfpointxy{\tikz@arc@x}{0}}% 65 | \pgfmathveclen@{\pgf@x}{\pgf@y}% 66 | \edef\tikz@arc@x{\pgfmathresult pt}% 67 | \pgf@process{\pgfpointxy{0}{\tikz@arc@y}}% 68 | \pgfmathveclen@{\pgf@x}{\pgf@y}% 69 | \edef\tikz@arc@y{\pgfmathresult pt}% 70 | \pgfpatharcto{\tikz@arc@x}{\tikz@arc@y} 71 | {\pgfkeysvalueof{/tikz/arc rotation}}{\pgfkeysvalueof{/tikz/arc/large}} 72 | {\pgfkeysvalueof{/tikz/arc/ccw}}{#1}% 73 | \fi 74 | \fi 75 | \endgroup 76 | % \edef\tikz@timer@start@angle{\expandafter\expandafter\expandafter\pgfutil@firstoffour\expandafter\pgfutil@gobble\pgf@marshal}% 77 | % \edef\tikz@timer@end@angle{\expandafter\expandafter\expandafter\pgfutil@secondoffour\expandafter\pgfutil@gobble\pgf@marshal}% 78 | % \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\def 79 | % \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\tikz@timer@zero@axis 80 | % \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{% 81 | % \expandafter\expandafter\expandafter\pgfutil@thirdoffour\expandafter\pgfutil@gobble\pgf@marshal}% 82 | % \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\def 83 | % \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\tikz@timer@ninety@axis 84 | % \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{% 85 | % \expandafter\expandafter\expandafter\pgfutil@fourthoffour\expandafter\pgfutil@gobble\pgf@marshal}% 86 | \let\tikz@timer=\tikz@timer@arc 87 | \tikz@scan@next@command 88 | } 89 | \def\pgfutil@firstoffour#1#2#3#4{#1} 90 | \def\pgfutil@secondoffour#1#2#3#4{#2} 91 | \def\pgfutil@thirdoffour#1#2#3#4{#3} 92 | \def\pgfutil@fourthoffour#1#2#3#4{#4} 93 | \endinput 94 | -------------------------------------------------------------------------------- /tikzlibraryqrr.labels-pins-plus.code.tex: -------------------------------------------------------------------------------- 1 | \def\tikz@swapanchor#1.#2\tikz@stop#3#4{#1#4#3} 2 | \def\tikz@add@anchor#1#2{% 3 | \edef\tikz@temp{{#1}{#2}}% 4 | \expandafter\pgfutil@in@\tikz@temp 5 | \ifpgfutil@in@\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi 6 | {% 7 | \def\tikz@temp{#2}\ifx\tikz@temp\pgfutil@empty 8 | \expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi 9 | {\edef#1{\expandafter\tikz@swapanchor#1\tikz@stop{}{}}} 10 | {\edef#1{\expandafter\tikz@swapanchor#1\tikz@stop{#2}{.}}}% 11 | }{% 12 | \def\tikz@temp{#2}\ifx\tikz@temp\pgfutil@empty 13 | \expandafter\pgfutil@gobble\else\expandafter\pgfutil@firstofone 14 | {\edef#1{#1.#2}}% 15 | }} 16 | \tikzset{ 17 | pin anchor/.style={tikz@pin@post/.append style={anchor=#1}}, 18 | label anchor/.style={tikz@label@post/.append style={anchor=#1}}, 19 | pin edge pin anchor/.style={ 20 | append after command={\pgfextra\tikz@add@anchor{\tikzlastnode}{#1}\endpgfextra}}, 21 | pin edge parent anchor/.style={ 22 | append after command={\pgfextra\tikz@add@anchor{\tikz@save@last@node}{#1}\endpgfextra}}} --------------------------------------------------------------------------------