Skip to content

Commit ca34542

Browse files
committed
Completed basic_dashes specification.
1 parent 0fbae32 commit ca34542

File tree

2 files changed

+155
-6
lines changed

2 files changed

+155
-6
lines changed

β€Žsource/dashes.tex

Lines changed: 142 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,146 @@
22

33
\rSec0 [\iotwod.dashes] {Class template \tcode{basic_dashes}}
44

5+
\rSec1 [\iotwod.dashes.intro] {\tcode{basic_dashes} class template}
6+
7+
\pnum
8+
\indexlibrary{\idxcode{basic_dashes}}%
9+
The class template \tcode{basic_dashes} describes a pattern for determining, in conjunction with other properties, what points on a path are included when a stroking operation is performed.
10+
11+
\pnum
12+
It has an \term{offset} of type \tcode{float} and a \term{pattern} of an unspecified type capable of sequentially storing floating-point values.
13+
14+
\pnum
15+
The data are stored in an object of type \tcode{typename GraphicsSurfaces::surface_props_data::dashes_props_data_type}. It is accessible using the \tcode{data} member function.
16+
17+
\rSec1 [\iotwod.dashes.synopsis] {Synopsis}
18+
19+
\begin{codeblock}
20+
namespace std::experimental::io2d::v1 {
21+
template <class GraphicsSurfaces>
22+
class basic_dashes {
23+
public:
24+
using data_type =
25+
typename GraphicsSurfaces::surface_state_props::dashes_data_type;
26+
public:
27+
// \ref{\iotwod.dashes.cons}, constructors:
28+
basic_dashes() noexcept;
29+
template <class InputIterator>
30+
basic_dashes(float o, InputIterator first, InputIterator last);
31+
basic_dashes(float o, initializer_list<float> il);
32+
33+
// \ref{\iotwod.dashes.observers}, observers:
34+
const data_type& data() const noexcept;
35+
};
36+
37+
// \ref{\iotwod.dashes.ops}, operators:
38+
template <class GraphicsSurfaces>
39+
bool operator==(const basic_dashes<GraphicsSurfaces>& lhs,
40+
const basic_dashes<GraphicsSurfaces>& rhs) noexcept;
41+
template <class GraphicsSurfaces>
42+
bool operator!=(const basic_dashes<GraphicsSurfaces>& lhs,
43+
const basic_dashes<GraphicsSurfaces>& rhs) noexcept;
44+
}
45+
\end{codeblock}
46+
47+
\rSec1 [\iotwod.dashes.cons] {Constructors}
48+
49+
\indexlibrary{\idxcode{basic_dashes}!constructor}%
50+
\begin{itemdecl}
51+
basic_dashes() noexcept;
52+
\end{itemdecl}
53+
\begin{itemdescr}
54+
\pnum
55+
\effects
56+
Constructs an object of type \tcode{basic_dashes}.
57+
58+
\pnum
59+
\postconditions
60+
\tcode{data() == GraphicsSurfaces::surface_state_props::create_dashes()}.
61+
62+
\pnum
63+
\remarks
64+
The offset is \tcode{0.0f} and the pattern contains no values.
65+
\end{itemdescr}
66+
67+
\indexlibrary{\idxcode{basic_dashes}!constructor}%
68+
\begin{itemdecl}
69+
template <class InputIterator>
70+
basic_dashes(float o, InputIterator first, InputIterator last);
71+
\end{itemdecl}
72+
\begin{itemdescr}
73+
\pnum
74+
\requires
75+
The value type of \tcode{InputIterator} is \tcode{float}.
76+
77+
\pnum
78+
Each value from \tcode{first} through \tcode{last - 1} is greater than or equal to \tcode{0.0f}.
79+
80+
\pnum
81+
\effects
82+
Constructs an object of type \tcode{basic_dashes}.
83+
84+
\pnum
85+
\postconditions
86+
\tcode{data() == GraphicsSurfaces::surface_state_props::create_dashes(o, first, last)}.
87+
88+
\pnum
89+
\remarks
90+
The offset is \tcode{o} and the pattern is the sequential list of value beginning at \tcode{first} and ending at \tcode{last - 1}.
91+
\end{itemdescr}
92+
93+
\indexlibrary{\idxcode{basic_dashes}!constructor}%
94+
\begin{itemdecl}
95+
basic_dashes(float o, initializer_list<float> il);
96+
\end{itemdecl}
97+
\begin{itemdescr}
98+
\pnum
99+
\requires
100+
Each value in \tcode{il} is greater than or equal to \tcode{0.0f}.
101+
102+
\pnum
103+
\effects
104+
Constructs an object of type \tcode{basic_dashes}.
105+
106+
\pnum
107+
\postconditions
108+
\tcode{data() == GraphicsSurfaces::surface_state_props::create_dashes(o, il)}.
109+
\end{itemdescr}
110+
111+
\rSec1 [\iotwod.dashes.observers] {Observers}
112+
113+
\indexlibrarymember{data}{basic_brush}
114+
\begin{itemdecl}
115+
const data_type& data() const noexcept;
116+
\end{itemdecl}
117+
\begin{itemdescr}
118+
\pnum
119+
\returns
120+
A reference to the \tcode{basic_dashes} object's data object (See \ref{\iotwod.dashes.intro}).
121+
\end{itemdescr}
122+
123+
\rSec1 [\iotwod.dashes.ops] {Operators}
124+
125+
\pnum
126+
\begin{itemdecl}
127+
template <class GraphicsSurfaces>
128+
bool operator==(const basic_dashes<GraphicsSurfaces>& lhs,
129+
const basic_dashes<GraphicsSurfaces>& rhs) noexcept;
130+
\end{itemdecl}
131+
\begin{itemdescr}
132+
\pnum
133+
\returns
134+
\tcode{GraphicsSurfaces::surface_state_props::equal(lhs.data(), rhs.data())}.
135+
\end{itemdescr}
136+
137+
\pnum
138+
\begin{itemdecl}
139+
template <class GraphicsSurfaces>
140+
bool operator!=(const basic_dashes<GraphicsSurfaces>& lhs,
141+
const basic_dashes<GraphicsSurfaces>& rhs) noexcept;
142+
\end{itemdecl}
143+
\begin{itemdescr}
5144
\pnum
6-
<TODO>
145+
\returns
146+
\tcode{GraphicsSurfaces::surface_state_props::not_equal(lhs.data(), rhs.data())}.
147+
\end{itemdescr}

β€Žsource/graph-surf-surfstate.tex

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
\tcode{basic_stroke_props} \\ \rowsep
3838
\tcode{mask_props_data_type} &
3939
\tcode{basic_mask_props} \\ \rowsep
40-
\tcode{basic_dashes} &
41-
\tcode{dashes_data_type} \\
40+
\tcode{dashes_data_type} &
41+
\tcode{basic_dashes} \\
4242
\end{libreqtab2}
4343

4444
\pnum
@@ -102,10 +102,10 @@
102102
\tcode{mask_props_data_type} &
103103
\tcode{m} &
104104
\tcode{M} \\ \rowsep
105-
\tcode{dashes_data_type} &
105+
\tcode{dashes_props_data_type} &
106106
\tcode{o} &
107107
\tcode{float} \\ \rowsep
108-
\tcode{dashes_data_type} &
108+
\tcode{dashes_props_data_type} &
109109
\tcode{p} &
110110
\tcode{vector<float>} \\
111111
\end{libiotwodreqtab3f}
@@ -421,5 +421,13 @@
421421
\returns
422422
An object \tcode{d}. &
423423
\postconditions
424-
\tcode{d.o == o} and \tcode{d.p == vector<float>(il)}. \\
424+
\tcode{d.o == o} and \tcode{d.p == vector<float>(il)}. \\ \rowsep
425+
\tcode{X::surface_state_props::equal(const DA\& lhs, const DA\& rhs)} &
426+
\tcode{bool} &
427+
\returns
428+
\tcode{lhs.o == rhs.o \&\& lhs.p == rhs.p}. \\ \rowsep
429+
\tcode{X::surface_state_props::not_equal(const DA\& lhs, const DA\& rhs)} &
430+
\tcode{bool} &
431+
\returns
432+
\tcode{lhs.o != rhs.o || lhs.p != rhs.p}. \\
425433
\end{libreqtab4d}

0 commit comments

Comments
 (0)