| 139 | } |
| 140 | |
| 141 | int |
| 142 | Renderer::drawCube(const Matrix &points, const Vector &values, int tag, int mode) |
| 143 | { |
| 144 | |
| 145 | static Matrix polyData(4,3); |
| 146 | static Vector polyValues(4); |
| 147 | // draw the 6 faces |
| 148 | |
| 149 | int a,b,c,d; |
| 150 | |
| 151 | a=2; b=3; c=7; d=6; |
| 152 | for (int i=0; i<3; i++) { |
| 153 | polyData(0,i) = points(a,i); |
| 154 | polyData(1,i) = points(b,i); |
| 155 | polyData(2,i) = points(c,i); |
| 156 | polyData(3,i) = points(d,i); |
| 157 | } |
| 158 | polyValues(0) = values(a); |
| 159 | polyValues(1) = values(b); |
| 160 | polyValues(2) = values(c); |
| 161 | polyValues(3) = values(d); |
| 162 | this->drawPolygon(polyData, polyValues, tag, mode); |
| 163 | |
| 164 | a=5; b=4; c=0; d=1; |
| 165 | for (int i=0; i<3; i++) { |
| 166 | polyData(0,i) = points(a,i); |
| 167 | polyData(1,i) = points(b,i); |
| 168 | polyData(2,i) = points(c,i); |
| 169 | polyData(3,i) = points(d,i); |
| 170 | } |
| 171 | polyValues(0) = values(a); |
| 172 | polyValues(1) = values(b); |
| 173 | polyValues(2) = values(c); |
| 174 | polyValues(3) = values(d); |
| 175 | this->drawPolygon(polyData, polyValues, tag, mode); |
| 176 | |
| 177 | a=6; b=7; c=4; d=5; |
| 178 | for (int i=0; i<3; i++) { |
| 179 | polyData(0,i) = points(a,i); |
| 180 | polyData(1,i) = points(b,i); |
| 181 | polyData(2,i) = points(c,i); |
| 182 | polyData(3,i) = points(d,i); |
| 183 | } |
| 184 | polyValues(0) = values(a); |
| 185 | polyValues(1) = values(b); |
| 186 | polyValues(2) = values(c); |
| 187 | polyValues(3) = values(d); |
| 188 | this->drawPolygon(polyData, polyValues, tag, mode); |
| 189 | |
| 190 | a=1; b=0; c=3; d=2; |
| 191 | for (int i=0; i<3; i++) { |
| 192 | polyData(0,i) = points(a,i); |
| 193 | polyData(1,i) = points(b,i); |
| 194 | polyData(2,i) = points(c,i); |
| 195 | polyData(3,i) = points(d,i); |
| 196 | } |
| 197 | polyValues(0) = values(a); |
| 198 | polyValues(1) = values(b); |
no test coverage detected