summaryrefslogtreecommitdiff
path: root/info/visualtikz/Source/tkzscope.tex
blob: 7ef1d0a71c9e2993d4552ad24bc364f713991ef5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106

\SbSSCT{Environnement Scope}{Environment Scope}

\begin{center}
\RRR{12-3}
\end{center}

\begin{tabular}{|c|c|} \hline
\parbox[b]{8cm}{
\BS{begin}\AC{tikzpicture}[line width = 3mm] \\ \\
\BS{draw}  (0.5,6) - - (2.5,6);\\

\ESS{scope}[{\color{red}red}] \\
\BS{draw} (0.5,5) - - (2.5,5); \\
\BS{draw}  (0.5,4) - - (2.5,4);\\
\BS{end\AC{scope}} \\ \\
\BS{draw}  (0.5,3) - - (2.5,3);\\ \\
\ESS{scope}[{\color{red}green}] \\
\BS{draw}  (0.5,2) - - (2.5,2);\\
\BS{draw} [{\color{red}red}] (0.5,1) - - (2.5,1);\\
\BS{draw}  (0.5,0) - - (2.5,0);\\
\BS{end\AC{scope}} \\ \\
\BS{end}\AC{tikzpicture}
}
&  
\begin{tikzpicture}[line width = 3mm,baseline=-.5cm]
\draw[help lines] (0,0) grid (3,6);
\draw (0.5,6) -- (2.5,6);
\begin{scope}[red]
\draw (0.5,5) -- (2.5,5);
\draw (0.5,4) -- (2.5,4);
\end{scope}
\draw (0.5,3) -- (2.5,3);
\begin{scope}[green]
\draw (0.5,2) -- (2.5,2);
\draw[red]  (0.5,1) -- (2.5,1);
\draw (0.5,0) -- (2.5,0);
\end{scope}
\end{tikzpicture}
\\ \hline 
\end{tabular} 

\subsection{library scopes} 

\SbSbSSCT{Simplification d'un environnement scope}{Shorthand for Scope Environments}

\begin{center}
\RRR{12-3-2}
\end{center}

 \maboite{\BS{usetikzlibrary}\AC{scopes}}
\label{lib-scopes}

\begin{tabular}{|c|c|} \hline
\parbox[b]{8cm}{
\BS{begin}\AC{tikzpicture}[line width = 3mm] \\ \\
\BS{draw}  (0.5,6) - - (2.5,6);\\ \\
{\color{red} \{} [red] \\
\BS{draw} (0.5,5) - - (2.5,5); \\
\BS{draw}  (0.5,4) - - (2.5,4);\\
{\color{red} \} } \\ \\
\BS{draw}  (0.5,3) - - (2.5,3);\\ \\
{\color{red} \{ }[green] \\
\BS{draw}  (0.5,2) - - (2.5,2);\\
\BS{draw} [{\color{red}red}] (0.5,1) - - (2.5,1);\\
\BS{draw}  (0.5,0) - - (2.5,0);\\
{\color{red} \} }\\ \\
\BS{end}\AC{tikzpicture}
}
&  
\begin{tikzpicture}[line width = 3mm,baseline=-.5cm]
\draw[help lines] (0,0) grid (3,6);
\draw (0.5,6) -- (2.5,6);
{[red]
\draw (0.5,5) -- (2.5,5);
\draw (0.5,4) -- (2.5,4);
}
\draw (0.5,3) -- (2.5,3);
{[green]
\draw (0.5,2) -- (2.5,2);
\draw [red] (0.5,1) -- (2.5,1);
\draw (0.5,0) -- (2.5,0);
}
\end{tikzpicture}
\\ \hline 
\end{tabular} 

\SbSbSSCT{Portée d'un seul élément} {Single Command Scopes}

\begin{tabular}{|c|c|} \hline
\begin{tikzpicture}
\node [fill=white] at (1,1) {\DFR};
\scoped [on background layer]
\draw (0,0) grid (3,2);
\end{tikzpicture}
&
\begin{tikzpicture}
\node [fill=white] at (1,1) {\DFR};
\draw (0,0) grid (3,2);
\end{tikzpicture}
\\ \hline 
\BS{node} [fill=white] at (1,1) \AC{\BS{DFR}};  &\BS{node} [fill=white] at (1,1) \AC{\BS{DFR}}; \\
\BSS{scoped} [on background layer] & \\
\BS{draw} (0,0) grid (3,2); &  \BS{draw} (0,0) grid (3,2);
\\ \hline  
\end{tabular}