|
3 | 3 |
|
4 | 4 | \pnum
|
5 | 5 | \indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}}
|
6 |
| -The class \tcode{path_factory::path_arc_counterclockwise} describes an operation on a path group. |
| 6 | +The class \tcode{path_factory::path_arc_counterclockwise} describes a path segment that is a circular arc with counterclockwise rotation. |
7 | 7 |
|
8 | 8 | \pnum
|
9 |
| -This operation creates a circular arc with counterclockwise rotation. |
| 9 | +It has a center of type \tcode{vector_2d}, a radius of type \tcode{double}, a first angle of type \tcode{double}, and a second angle of type \tcode{double}. |
10 | 10 |
|
11 | 11 | \pnum
|
12 |
| -The unit for the values passed to and returned by \tcode{path_factory::path_arc_counterclockwise::angle_1} and \tcode{path_factory::path_arc_counterclockwise::angle_2} is the radian. |
| 12 | +The values for the first angle and second angle are in radians. |
13 | 13 |
|
14 | 14 | \pnum
|
15 |
| -The arc's \term{start point} is \tcode{vector_2d\{ *this.radius() * cos(*this.angle_1(), *this.radius() * -sin(*this.angle_1()) \} + *this.center()}. |
16 |
| - |
17 |
| -\pnum |
18 |
| -Its \term{end point} is \tcode{vector_2d\{ *this.radius() * cos(*this.angle_2(), *this.radius() * -sin(*this.angle_2()) \} + *this.center()}. |
19 |
| - |
20 |
| -\pnum |
21 |
| -If the current path geometry has a current point, a line is created from the current point to the start point before this arc operation is processed. Otherwise the start point is set as the current point and last-move-to point of the current path geometry. |
22 |
| - |
23 |
| -\pnum |
24 |
| -The arc rotates around the point returned by \tcode{*this.center()}. |
25 |
| - |
26 |
| -\pnum |
27 |
| -The arc begins at its start point and proceeds counterclockwise until it reaches its end point. |
28 |
| - |
29 |
| -\pnum |
30 |
| -The current point is set be to the arc's end point at the end of this operation. |
31 |
| - |
32 |
| -\pnum |
33 |
| -For purposes of determining whether a point is on the arc, if the value returned by \tcode{*this.angle_2()} is greater than the value returned by \tcode{*this.angle_1()} then the value returned by \tcode{*this.angle_2()} shall be continuously decremented by $2\pi$ until it is less than the value returned by \tcode{*this.angle_1()}. |
| 15 | +\enternote |
| 16 | +Although the value of the second angle may be greater than the value of the first angle, when processed as described in \ref{paths.processing}, \tcode{two_pi<double>} is subtracted from the second angle until the value of the first angle is greater than or equal to the value of the second angle. |
| 17 | +\exitnote |
34 | 18 |
|
35 | 19 | \rSec1 [pathfactory.patharccounterclockwise.synopsis] {\tcode{path_factory::path_arc_counterclockwise} synopsis}
|
36 | 20 |
|
37 | 21 | \begin{codeblock}
|
38 | 22 | namespace std { namespace experimental { namespace io2d { inline namespace v1 {
|
39 | 23 | class path_factory::path_arc_counterclockwise {
|
40 | 24 | public:
|
41 |
| - // \ref{pathfactory.patharccounterclockwise.cons}, construct/copy/move/destroy: |
42 |
| - arc_negative() noexcept; |
43 |
| - arc_negative(const arc_negative&) noexcept; |
44 |
| - path_factory::path_arc_counterclockwise& operator=(const arc_negative&) noexcept; |
45 |
| - arc_negative(arc_negative&&) noexcept; |
46 |
| - path_factory::path_arc_counterclockwise& operator=(arc_negative&&) noexcept; |
47 |
| - arc_negative(const vector_2d& ctr, double rad, double angle1, |
| 25 | + // \ref{pathfactory.patharccounterclockwise.cons}, construct: |
| 26 | + path_arc_counterclockwise(const vector_2d& ctr, double rad, double angle1, |
48 | 27 | double angle2) noexcept;
|
49 | 28 |
|
50 | 29 | // \ref{pathfactory.patharccounterclockwise.modifiers}, modifiers:
|
51 |
| - void center(const vector_2d& value) noexcept; |
52 |
| - void radius(double value) noexcept; |
| 30 | + void center(const vector_2d& ctr) noexcept; |
| 31 | + void radius(double r) noexcept; |
53 | 32 | void angle_1(double radians) noexcept;
|
54 | 33 | void angle_2(double radians) noexcept;
|
55 | 34 |
|
|
58 | 37 | double radius() const noexcept;
|
59 | 38 | double angle_1() const noexcept;
|
60 | 39 | double angle_2() const noexcept;
|
61 |
| - virtual path_data_type type() const noexcept override; |
62 |
| - |
63 |
| - private: |
64 |
| - vector_2d _Center; // \expos |
65 |
| - double _Radius; // \expos |
66 |
| - double _Angle_1; // \expos |
67 |
| - double _Angle_2; // \expos |
68 | 40 | };
|
69 | 41 | } } } }
|
70 | 42 | \end{codeblock}
|
71 | 43 |
|
72 | 44 | \rSec1 [pathfactory.patharccounterclockwise.cons] {\tcode{path_factory::path_arc_counterclockwise} constructors and assignment operators}
|
73 | 45 |
|
| 46 | +\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!constructor} |
74 | 47 | \indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!constructor}
|
75 | 48 | \begin{itemdecl}
|
76 |
| - arc_negative() noexcept; |
| 49 | + path_arc_counterclockwise(const vector_2d& ctr, double rad, double angle1, |
| 50 | + double angle2) noexcept; |
77 | 51 | \end{itemdecl}
|
78 | 52 | \begin{itemdescr}
|
79 | 53 | \pnum
|
80 | 54 | \effects
|
81 | 55 | Constructs an object of type \tcode{path_factory::path_arc_counterclockwise}.
|
82 | 56 |
|
83 | 57 | \pnum
|
84 |
| - \postconditions |
85 |
| - \tcode{_Center == vector_2d(0.0, 0.0)}. |
86 |
| - |
87 |
| - \tcode{_Radius == 0.0}. |
88 |
| - |
89 |
| - \tcode{_Angle_1 == 0.0}. |
90 |
| - |
91 |
| - \tcode{_Angle_2 == 0.0}. |
92 |
| -\end{itemdescr} |
93 |
| - |
94 |
| -\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!constructor} |
95 |
| -\begin{itemdecl} |
96 |
| - arc_negative(const vector_2d& ctr, double rad, double angle1, |
97 |
| - double angle2) noexcept; |
98 |
| -\end{itemdecl} |
99 |
| -\begin{itemdescr} |
| 58 | + The center shall be set to the value of \tcode{ctr}. |
| 59 | + |
100 | 60 | \pnum
|
101 |
| - \effects |
102 |
| - Constructs an object of type \tcode{path_factory::path_arc_counterclockwise}. |
| 61 | + The radius shall be set to the value of \tcode{rad}. |
103 | 62 |
|
104 | 63 | \pnum
|
105 |
| - \postconditions |
106 |
| - \tcode{_Center == ctr}. |
| 64 | + The first angle shall be set to the value of \tcode{angle1}. |
107 | 65 |
|
108 |
| - \tcode{_Radius == rad}. |
109 |
| - |
110 |
| - \tcode{_Angle_1 == angle1}. |
111 |
| - |
112 |
| - \tcode{_Angle_2 == angle2}. |
| 66 | + \pnum |
| 67 | + The second angle shall be set to the value of \tcode{angle2}. |
113 | 68 | \end{itemdescr}
|
114 | 69 |
|
115 | 70 | \rSec1 [pathfactory.patharccounterclockwise.modifiers]{\tcode{path_factory::path_arc_counterclockwise} modifiers}
|
116 | 71 |
|
117 | 72 | \indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{center}}
|
118 | 73 | \indexlibrary{\idxcode{center}!\idxcode{path_factory::path_arc_counterclockwise}}
|
119 | 74 | \begin{itemdecl}
|
120 |
| - void center(const vector_2d& value) noexcept; |
| 75 | + void center(const vector_2d& ctr) noexcept; |
121 | 76 | \end{itemdecl}
|
122 | 77 | \begin{itemdescr}
|
123 | 78 | \pnum
|
124 |
| - \postconditions |
125 |
| - \tcode{_Center == value}. |
| 79 | + \effects |
| 80 | + The center shall be set to the value of \tcode{ctr}. |
126 | 81 | \end{itemdescr}
|
127 | 82 |
|
128 | 83 | \indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{radius}}
|
129 | 84 | \indexlibrary{\idxcode{radius}!\idxcode{path_factory::path_arc_counterclockwise}}
|
130 | 85 | \begin{itemdecl}
|
131 |
| - void radius(double value) noexcept; |
| 86 | + void radius(double r) noexcept; |
132 | 87 | \end{itemdecl}
|
133 | 88 | \begin{itemdescr}
|
134 | 89 | \pnum
|
135 |
| - \postconditions |
136 |
| - \tcode{_Radius == value}. |
| 90 | + \effects |
| 91 | + The radius shall be set to the value of \tcode{r}. |
137 | 92 | \end{itemdescr}
|
138 | 93 |
|
139 | 94 | \indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{angle_1}}
|
140 | 95 | \indexlibrary{\idxcode{angle_1}!\idxcode{path_factory::path_arc_counterclockwise}}
|
141 | 96 | \begin{itemdecl}
|
142 |
| - void angle_1(double value) noexcept; |
| 97 | + void angle_1(double radians) noexcept; |
143 | 98 | \end{itemdecl}
|
144 | 99 | \begin{itemdescr}
|
145 | 100 | \pnum
|
146 |
| - \postconditions |
147 |
| - \tcode{_Angle_1 == value}. |
| 101 | + \effects |
| 102 | + The first angle shall be set to the value of \tcode{radians}. |
148 | 103 | \end{itemdescr}
|
149 | 104 |
|
150 | 105 | \indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{angle_2}}
|
151 | 106 | \indexlibrary{\idxcode{angle_2}!\idxcode{path_factory::path_arc_counterclockwise}}
|
152 | 107 | \begin{itemdecl}
|
153 |
| - void angle_2(double value) noexcept; |
| 108 | + void angle_2(double radians) noexcept; |
154 | 109 | \end{itemdecl}
|
155 | 110 | \begin{itemdescr}
|
156 | 111 | \pnum
|
157 |
| - \postconditions |
158 |
| - \tcode{_Angle_2 == value}. |
| 112 | + \effects |
| 113 | + The second angle shall be set to the value of \tcode{radians}. |
159 | 114 | \end{itemdescr}
|
160 | 115 |
|
161 | 116 | \rSec1 [pathfactory.patharccounterclockwise.observers]{\tcode{path_factory::path_arc_counterclockwise} observers}
|
|
168 | 123 | \begin{itemdescr}
|
169 | 124 | \pnum
|
170 | 125 | \returns
|
171 |
| - \tcode{_Center}. |
| 126 | + The value of the center. |
172 | 127 | \end{itemdescr}
|
173 | 128 |
|
174 | 129 | \indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{radius}}
|
|
179 | 134 | \begin{itemdescr}
|
180 | 135 | \pnum
|
181 | 136 | \returns
|
182 |
| - \tcode{_Radius}. |
| 137 | + The value of the radius. |
183 | 138 | \end{itemdescr}
|
184 | 139 |
|
185 | 140 | \indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{angle_1}}
|
|
190 | 145 | \begin{itemdescr}
|
191 | 146 | \pnum
|
192 | 147 | \returns
|
193 |
| - \tcode{_Angle_1}. |
| 148 | + The value of the first angle. |
194 | 149 | \end{itemdescr}
|
195 | 150 |
|
196 | 151 | \indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{angle_2}}
|
|
201 | 156 | \begin{itemdescr}
|
202 | 157 | \pnum
|
203 | 158 | \returns
|
204 |
| - \tcode{_Angle_2}. |
205 |
| -\end{itemdescr} |
206 |
| - |
207 |
| -\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{type}} |
208 |
| -\indexlibrary{\idxcode{type}!\idxcode{path_factory::path_arc_counterclockwise}} |
209 |
| -\begin{itemdecl} |
210 |
| - virtual path_data_type type() const noexcept override; |
211 |
| -\end{itemdecl} |
212 |
| -\begin{itemdescr} |
213 |
| - \pnum |
214 |
| - \returns |
215 |
| - \tcode{path_data_type::arc_negative}. |
| 159 | + The value of the second angle. |
216 | 160 | \end{itemdescr}
|
0 commit comments