Initialize the edge by the vertices v0 and v2 (ordered in y) `onRight' is true if the edge in on the right side of the triangle.
| 252 | // Initialize the edge by the vertices v0 and v2 (ordered in y) |
| 253 | // `onRight' is true if the edge in on the right side of the triangle. |
| 254 | void Init(vtkVertexEntry* v0, vtkVertexEntry* v2, int dx20, int dy20, int onRight) |
| 255 | { |
| 256 | double z0 = v0->GetZview(); |
| 257 | double z2 = v2->GetZview(); |
| 258 | |
| 259 | double invW0 = v0->GetInvW(); |
| 260 | double invW2 = v2->GetInvW(); |
| 261 | |
| 262 | double pv0[VTK_VALUES_SIZE]; |
| 263 | double pv2[VTK_VALUES_SIZE]; |
| 264 | int i = 0; |
| 265 | while (i < VTK_VALUES_SIZE) |
| 266 | { |
| 267 | pv0[i] = v0->GetValues()[i] * invW0; |
| 268 | this->PValues[i] = pv0[i]; |
| 269 | pv2[i] = v2->GetValues()[i] * invW2; |
| 270 | ++i; |
| 271 | } |
| 272 | |
| 273 | this->InvW = invW0; |
| 274 | this->Zview = z0; |
| 275 | |
| 276 | int x0 = v0->GetScreenX(); |
| 277 | int x2 = v2->GetScreenX(); |
| 278 | |
| 279 | this->X0 = x0; |
| 280 | this->X2 = x2; |
| 281 | |
| 282 | this->V2 = v2; |
| 283 | |
| 284 | this->X = x0; |
| 285 | |
| 286 | if (dx20 == 0) |
| 287 | { |
| 288 | this->Case = VTK_CASE_VERTICAL; |
| 289 | double invDy20 = 1.0 / dy20; |
| 290 | i = 0; |
| 291 | while (i < VTK_VALUES_SIZE) |
| 292 | { |
| 293 | this->Dpv[i] = (pv2[i] - pv0[i]) * invDy20; |
| 294 | ++i; |
| 295 | } |
| 296 | this->DinvW = (invW2 - invW0) * invDy20; |
| 297 | this->Dz = (z2 - z0) * invDy20; |
| 298 | } |
| 299 | else |
| 300 | { |
| 301 | if (dx20 > 0) |
| 302 | { |
| 303 | this->IncX = 1; |
| 304 | if (dx20 > dy20) |
| 305 | { |
| 306 | // Mostly horizontal |
| 307 | #ifdef HORI_EDGE_EQUATION |
| 308 | if (onRight) |
| 309 | { |
| 310 | this->Case = VTK_CASE_HORIZONTAL_IN_TO_OUT; |
| 311 | } |
nothing calls this directly
no test coverage detected