|
| 1 | +%!TEX root = io2d.tex |
| 2 | +\rSec0 [\iotwod.displaypt] {Class template \tcode{basic_display_point}} |
| 3 | + |
| 4 | +\rSec1 [\iotwod.displaypt.intro] {\tcode{basic_display_point} description} |
| 5 | + |
| 6 | +\indexlibrary{\idxcode{basic_display_point}}% |
| 7 | +\pnum |
| 8 | +The class template \tcode{basic_display_point} describes an integral point used to describe certain properties of surfaces. |
| 9 | + |
| 10 | +\pnum |
| 11 | +It has an \term{x coordinate} of type \tcode{int} and a \term{y coordinate} of type \tcode{int}. |
| 12 | + |
| 13 | +\pnum |
| 14 | +The data are stored in an object of type \tcode{typename GraphicsMath::display_point_data_type}. It is accessible using the \tcode{data} member functions. |
| 15 | + |
| 16 | +\rSec1 [\iotwod.displaypt.synopsis] {\tcode{basic_display_point} synopsis} |
| 17 | + |
| 18 | +\begin{codeblock} |
| 19 | +namespace std::experimental::io2d::v1 { |
| 20 | + template <class GraphicsMath> |
| 21 | + class basic_display_point { |
| 22 | + public: |
| 23 | + using data_type = typename GraphicsMath::display_point_data_type; |
| 24 | + |
| 25 | + // \ref{\iotwod.displaypt.cons}, constructors: |
| 26 | + basic_display_point() noexcept; |
| 27 | + basic_display_point(int x, int y) noexcept; |
| 28 | + basic_display_point(const data_type& val) noexcept; |
| 29 | + |
| 30 | + // \ref{\iotwod.displaypt.accessors}, accessors: |
| 31 | + const data_type& data() const noexcept; |
| 32 | + data_type& data() noexcept; |
| 33 | + |
| 34 | + // \ref{\iotwod.displaypt.modifiers}, modifiers: |
| 35 | + void x(int val) noexcept; |
| 36 | + void y(int val) noexcept; |
| 37 | + |
| 38 | + // \ref{\iotwod.displaypt.observers}, observers: |
| 39 | + int x() const noexcept; |
| 40 | + int y() const noexcept; |
| 41 | + }; |
| 42 | + |
| 43 | + // \ref{\iotwod.displaypt.ops}, operators: |
| 44 | + template <class GraphicsMath> |
| 45 | + bool operator==(const basic_display_point<GraphicsMath>& lhs, |
| 46 | + const basic_display_point<GraphicsMath>& rhs) noexcept; |
| 47 | + template <class GraphicsMath> |
| 48 | + bool operator!=(const basic_display_point<GraphicsMath>& lhs, |
| 49 | + const basic_display_point<GraphicsMath>& rhs) noexcept; |
| 50 | +} |
| 51 | +\end{codeblock} |
| 52 | + |
| 53 | +\rSec1 [\iotwod.displaypt.cons] {\tcode{basic_display_point} constructors} |
| 54 | + |
| 55 | +\indexlibrary{\idxcode{basic_display_point}!constructor}% |
| 56 | +\begin{itemdecl} |
| 57 | +basic_display_point() noexcept; |
| 58 | +\end{itemdecl} |
| 59 | +\begin{itemdescr} |
| 60 | +\pnum |
| 61 | +\effects |
| 62 | +Constructs an object of type \tcode{basic_display_point}. |
| 63 | + |
| 64 | +\pnum |
| 65 | +\postconditions |
| 66 | +\tcode{data() == GraphicsMath::create_display_point()}. |
| 67 | + |
| 68 | +\pnum |
| 69 | +\remarks |
| 70 | +The x coordinate is \tcode{0} and the y coordinate is \tcode{0}. |
| 71 | +\end{itemdescr} |
| 72 | + |
| 73 | +\indexlibrary{\idxcode{basic_display_point}!constructor}% |
| 74 | +\begin{itemdecl} |
| 75 | +basic_display_point(int x, int y) noexcept; |
| 76 | +\end{itemdecl} |
| 77 | +\begin{itemdescr} |
| 78 | +\pnum |
| 79 | +\effects |
| 80 | +Constructs an object of type \tcode{basic_display_point}. |
| 81 | + |
| 82 | +\pnum |
| 83 | +\postconditions |
| 84 | +\tcode{data() == GraphicsMath::create_display_point(x, y)}. |
| 85 | + |
| 86 | +\pnum |
| 87 | +\remarks |
| 88 | +The x coordinate is \tcode{x} and the y coordinate is \tcode{y}. |
| 89 | +\end{itemdescr} |
| 90 | + |
| 91 | +\indexlibrary{\idxcode{basic_display_point}!constructor}% |
| 92 | +\begin{itemdecl} |
| 93 | +basic_display_point(const data_type& val) noexcept; |
| 94 | +\end{itemdecl} |
| 95 | +\begin{itemdescr} |
| 96 | +\pnum |
| 97 | +\effects |
| 98 | +Constructs an object of type \tcode{basic_display_point}. |
| 99 | + |
| 100 | +\pnum |
| 101 | +\postconditions |
| 102 | +\tcode{data() == val}. |
| 103 | + |
| 104 | +\pnum |
| 105 | +\remarks |
| 106 | +The x coordinate is \tcode{GraphicsMath::x(val)} and the y coordinate is \tcode{GraphicsMath::y(val)}. |
| 107 | +\end{itemdescr} |
| 108 | + |
| 109 | +\rSec1 [\iotwod.displaypt.accessors]{\tcode{basic_display_point} accessors} |
| 110 | + |
| 111 | +\indexlibrarymember{data}{basic_display_point}% |
| 112 | +\begin{itemdecl} |
| 113 | +const data_type& data() const noexcept; |
| 114 | +data_type& data() noexcept; |
| 115 | +\end{itemdecl} |
| 116 | +\begin{itemdescr} |
| 117 | +\pnum |
| 118 | +\returns |
| 119 | +A reference to the \tcode{basic_display_point} object's data object (See: \ref{\iotwod.displaypt.intro}). |
| 120 | +\end{itemdescr} |
| 121 | + |
| 122 | +\rSec1 [\iotwod.displaypt.modifiers]{\tcode{basic_display_point} modifiers} |
| 123 | + |
| 124 | +\indexlibrarymember{x}{basic_display_point}% |
| 125 | +\begin{itemdecl} |
| 126 | +void x(int v) noexcept; |
| 127 | +\end{itemdecl} |
| 128 | +\begin{itemdescr} |
| 129 | +\pnum |
| 130 | +\effects |
| 131 | +Equivalent to \tcode{GraphicsMath::x(data(), v);} |
| 132 | +\end{itemdescr} |
| 133 | + |
| 134 | +\indexlibrarymember{y}{basic_display_point}% |
| 135 | +\begin{itemdecl} |
| 136 | +void y(int v) noexcept; |
| 137 | +\end{itemdecl} |
| 138 | +\begin{itemdescr} |
| 139 | +\pnum |
| 140 | +\effects |
| 141 | +Equivalent to \tcode{GraphicsMath::y(data(), v);} |
| 142 | +\end{itemdescr} |
| 143 | + |
| 144 | +\rSec1 [\iotwod.displaypt.observers]{\tcode{basic_display_point} observers} |
| 145 | + |
| 146 | +\indexlibrarymember{x}{basic_display_point}% |
| 147 | +\begin{itemdecl} |
| 148 | +int x() const noexcept; |
| 149 | +\end{itemdecl} |
| 150 | +\begin{itemdescr} |
| 151 | +\pnum |
| 152 | +\returns |
| 153 | +\tcode{GraphicsMath::x(data())}. |
| 154 | +\end{itemdescr} |
| 155 | + |
| 156 | +\indexlibrarymember{y}{basic_display_point}% |
| 157 | +\begin{itemdecl} |
| 158 | +int y() const noexcept; |
| 159 | +\end{itemdecl} |
| 160 | +\begin{itemdescr} |
| 161 | +\pnum |
| 162 | +\returns |
| 163 | +\tcode{GraphicsMath::y(data())}. |
| 164 | +\end{itemdescr} |
| 165 | + |
| 166 | +\rSec1 [\iotwod.displaypt.ops] {\tcode{basic_display_point} operators} |
| 167 | + |
| 168 | +\indexlibrarymember{operator==}{basic_display_point}% |
| 169 | +\begin{itemdecl} |
| 170 | +bool operator==(const basic_display_point<GraphicsMath>& lhs, |
| 171 | + const basic_display_point<GraphicsMath>& rhs) noexcept; |
| 172 | +\end{itemdecl} |
| 173 | +\begin{itemdescr} |
| 174 | +\pnum |
| 175 | +\returns |
| 176 | +\tcode{GraphicsMath::equal(lhs.data(), rhs.data())}. |
| 177 | +\end{itemdescr} |
| 178 | + |
| 179 | +\indexlibrarymember{operator!=}{basic_display_point}% |
| 180 | +\begin{itemdecl} |
| 181 | +bool operator!=(const basic_display_point<GraphicsMath>& lhs, |
| 182 | + const basic_display_point<GraphicsMath>& rhs) noexcept; |
| 183 | +\end{itemdecl} |
| 184 | +\begin{itemdescr} |
| 185 | +\pnum |
| 186 | +\returns |
| 187 | +\tcode{GraphicsMath::not_equal(lhs.data(), rhs.data())}. |
| 188 | +\end{itemdescr} |
0 commit comments