Skip to content

Commit 267a0c7

Browse files
committed
Finished fixing up the various classes in path_factory::path_data.
1 parent a98953e commit 267a0c7

12 files changed

+270
-795
lines changed

β€Žsource/arc-negative.tex

Lines changed: 35 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,32 @@
33

44
\pnum
55
\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.
77

88
\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}.
1010

1111
\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.
1313

1414
\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
3418

3519
\rSec1 [pathfactory.patharccounterclockwise.synopsis] {\tcode{path_factory::path_arc_counterclockwise} synopsis}
3620

3721
\begin{codeblock}
3822
namespace std { namespace experimental { namespace io2d { inline namespace v1 {
3923
class path_factory::path_arc_counterclockwise {
4024
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,
4827
double angle2) noexcept;
4928

5029
// \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;
5332
void angle_1(double radians) noexcept;
5433
void angle_2(double radians) noexcept;
5534

@@ -58,104 +37,80 @@
5837
double radius() const noexcept;
5938
double angle_1() const noexcept;
6039
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
6840
};
6941
} } } }
7042
\end{codeblock}
7143

7244
\rSec1 [pathfactory.patharccounterclockwise.cons] {\tcode{path_factory::path_arc_counterclockwise} constructors and assignment operators}
7345

46+
\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!constructor}
7447
\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!constructor}
7548
\begin{itemdecl}
76-
arc_negative() noexcept;
49+
path_arc_counterclockwise(const vector_2d& ctr, double rad, double angle1,
50+
double angle2) noexcept;
7751
\end{itemdecl}
7852
\begin{itemdescr}
7953
\pnum
8054
\effects
8155
Constructs an object of type \tcode{path_factory::path_arc_counterclockwise}.
8256

8357
\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+
10060
\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}.
10362

10463
\pnum
105-
\postconditions
106-
\tcode{_Center == ctr}.
64+
The first angle shall be set to the value of \tcode{angle1}.
10765

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}.
11368
\end{itemdescr}
11469

11570
\rSec1 [pathfactory.patharccounterclockwise.modifiers]{\tcode{path_factory::path_arc_counterclockwise} modifiers}
11671

11772
\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{center}}
11873
\indexlibrary{\idxcode{center}!\idxcode{path_factory::path_arc_counterclockwise}}
11974
\begin{itemdecl}
120-
void center(const vector_2d& value) noexcept;
75+
void center(const vector_2d& ctr) noexcept;
12176
\end{itemdecl}
12277
\begin{itemdescr}
12378
\pnum
124-
\postconditions
125-
\tcode{_Center == value}.
79+
\effects
80+
The center shall be set to the value of \tcode{ctr}.
12681
\end{itemdescr}
12782

12883
\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{radius}}
12984
\indexlibrary{\idxcode{radius}!\idxcode{path_factory::path_arc_counterclockwise}}
13085
\begin{itemdecl}
131-
void radius(double value) noexcept;
86+
void radius(double r) noexcept;
13287
\end{itemdecl}
13388
\begin{itemdescr}
13489
\pnum
135-
\postconditions
136-
\tcode{_Radius == value}.
90+
\effects
91+
The radius shall be set to the value of \tcode{r}.
13792
\end{itemdescr}
13893

13994
\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{angle_1}}
14095
\indexlibrary{\idxcode{angle_1}!\idxcode{path_factory::path_arc_counterclockwise}}
14196
\begin{itemdecl}
142-
void angle_1(double value) noexcept;
97+
void angle_1(double radians) noexcept;
14398
\end{itemdecl}
14499
\begin{itemdescr}
145100
\pnum
146-
\postconditions
147-
\tcode{_Angle_1 == value}.
101+
\effects
102+
The first angle shall be set to the value of \tcode{radians}.
148103
\end{itemdescr}
149104

150105
\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{angle_2}}
151106
\indexlibrary{\idxcode{angle_2}!\idxcode{path_factory::path_arc_counterclockwise}}
152107
\begin{itemdecl}
153-
void angle_2(double value) noexcept;
108+
void angle_2(double radians) noexcept;
154109
\end{itemdecl}
155110
\begin{itemdescr}
156111
\pnum
157-
\postconditions
158-
\tcode{_Angle_2 == value}.
112+
\effects
113+
The second angle shall be set to the value of \tcode{radians}.
159114
\end{itemdescr}
160115

161116
\rSec1 [pathfactory.patharccounterclockwise.observers]{\tcode{path_factory::path_arc_counterclockwise} observers}
@@ -168,7 +123,7 @@
168123
\begin{itemdescr}
169124
\pnum
170125
\returns
171-
\tcode{_Center}.
126+
The value of the center.
172127
\end{itemdescr}
173128

174129
\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{radius}}
@@ -179,7 +134,7 @@
179134
\begin{itemdescr}
180135
\pnum
181136
\returns
182-
\tcode{_Radius}.
137+
The value of the radius.
183138
\end{itemdescr}
184139

185140
\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{angle_1}}
@@ -190,7 +145,7 @@
190145
\begin{itemdescr}
191146
\pnum
192147
\returns
193-
\tcode{_Angle_1}.
148+
The value of the first angle.
194149
\end{itemdescr}
195150

196151
\indexlibrary{\idxcode{path_factory::path_arc_counterclockwise}!\idxcode{angle_2}}
@@ -201,16 +156,5 @@
201156
\begin{itemdescr}
202157
\pnum
203158
\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.
216160
\end{itemdescr}

β€Žsource/arc.tex

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,54 +11,20 @@
1111
\pnum
1212
The values for the first angle and second angle are in radians.
1313

14-
%\rSec1 [pathfactory.patharccounterclockwise.processing] {\tcode{path_factory::path_arc_counterclockwise} processing}
15-
%
16-
%\pnum
17-
%When sequentially processing the path group of a path factory, the effect of this class is as follows:
18-
%
19-
%\begin{enumerate}
20-
% \item Assign the value of the center to \tcode{ctr}.
21-
% \item Assign the value of the radius to \tcode{rad}.
22-
% \item Assign the value of the first angle to \tcode{ang1}.
23-
% \item Assign the value of the second angle to \tcode{ang2}.
24-
% %\item While \tcode{ang2} is less than \tcode{ang1} add \tcode{two_pi<double>} to \tcode{ang2}.
25-
%\end{enumerate}
26-
%\begin{codeblock}
27-
%#include <cmath>
28-
%#include <experimental/io2d>
29-
%using namespace std
30-
%\end{codeblock}
31-
%
32-
%
33-
%\pnum
34-
%The arc's start point is \tcode{vector_2d\{ *this.radius() * cos(*this.angle_1(), -(*this.radius() * -sin(*this.angle_1())) \} + *this.center()}.
35-
%
36-
%\pnum
37-
%Its \term{end point} is \tcode{vector_2d\{ *this.radius() * cos(*this.angle_2(), -(*this.radius() * -sin(*this.angle_2())) \} + *this.center()}.
38-
%
39-
%\pnum
40-
%When a \tcode{path_arc_clockwise} object is added to a path geometry that has a current point, a line is created from that current point to the arc's start point before the arc is. Otherwise the start point is set as the current point and last-move-to point of the current path geometry.
41-
%
42-
%\pnum
43-
%The arc rotates around its center.
44-
%
45-
%\pnum
46-
%The arc begins at its start point and proceeds clockwise until it reaches its end point.
47-
%
48-
%\pnum
49-
%The current point is set be to the arc's end point at the end of this operation.
50-
%
51-
%\pnum
52-
%For purposes of determining whether a point is on the arc, if the value returned by \tcode{*this.angle_2()} is less than the value returned by \tcode{*this.angle_1()} then the value returned by \tcode{*this.angle_2()} shall be continuously incremented by $2\pi$ until it is greater than the value returned by \tcode{*this.angle_1()}.
53-
%
14+
\pnum
15+
\enternote
16+
Although the value of the first angle may be greater than the value of the second angle, when processed as described in \ref{paths.processing}, \tcode{two_pi<double>} is added to the second angle until the value of the second angle is greater than or equal to the value of the first angle.
17+
\exitnote
18+
5419
\rSec1 [pathfactory.patharcclockwise.synopsis] {\tcode{path_factory::path_arc_clockwise} synopsis}
5520

5621
\begin{codeblock}
5722
namespace std { namespace experimental { namespace io2d { inline namespace v1 {
5823
class path_factory::path_arc_clockwise {
5924
public:
6025
// \ref{pathfactory.patharcclockwise.cons}, construct/copy/move/destroy:
61-
path_arc_clockwise(const vector_2d& ctr, double rad, double angle1, double angle2) noexcept;
26+
path_arc_clockwise(const vector_2d& ctr, double rad, double angle1,
27+
double angle2) noexcept;
6228

6329
// \ref{pathfactory.patharcclockwise.modifiers}, modifiers:
6430
void center(const vector_2d& ctr) noexcept;
@@ -79,7 +45,8 @@
7945

8046
\indexlibrary{\idxcode{path_factory::path_arc_clockwise}!constructor}
8147
\begin{itemdecl}
82-
arc(const vector_2d& ctr, double rad, double angle1, double angle2) noexcept;
48+
arc(const vector_2d& ctr, double rad, double angle1, double angle2)
49+
noexcept;
8350
\end{itemdecl}
8451
\begin{itemdescr}
8552
\pnum

0 commit comments

Comments
 (0)