| 479 | |
| 480 | |
| 481 | int |
| 482 | OpenGLRenderer::drawLine(const Vector &pos1, const Vector &pos2, |
| 483 | float V1, float V2, int tag, int mode) |
| 484 | { |
| 485 | // open gl does a divide by zero error if points are the same - so check |
| 486 | if (pos1(0) == pos2(0) && pos1(1) == pos2(1) && pos1(2) == pos2(2)) |
| 487 | return 0; |
| 488 | |
| 489 | glLineWidth(lineWidth); |
| 490 | |
| 491 | glBegin(GL_LINES); |
| 492 | float r, g, b; |
| 493 | |
| 494 | theMap->getRGB(V1, r, g, b); |
| 495 | glColor3f(r,g,b); |
| 496 | |
| 497 | glVertex3f(pos1(0),pos1(1),pos1(2)); |
| 498 | |
| 499 | if (theOutputFileName != 0) { |
| 500 | theFile << "Line\n" << pos1(0) << " " << pos1(1) << " " << pos1(2) |
| 501 | << " " << r << " " << g << " " << b << " " << endln; |
| 502 | } |
| 503 | |
| 504 | theMap->getRGB(V2, r, g, b); |
| 505 | glColor3f(r,g,b); |
| 506 | |
| 507 | glVertex3f(pos2(0),pos2(1),pos2(2)); |
| 508 | glEnd(); |
| 509 | |
| 510 | if (theOutputFileName != 0) { |
| 511 | theFile << pos2(0) << " " << pos2(1) << " " << pos2(2) << " " << r |
| 512 | << " " << g << " " << b << " " << endln; |
| 513 | } |
| 514 | |
| 515 | return 0; |
| 516 | } |
| 517 | |
| 518 | |
| 519 | |