#include <TridSketches.h>
Inheritance diagram for TridSketchTube:

Public Member Functions | |
| TridSketchTube (void) | |
| TridSketchTube (const TVector3 &end1, const TVector3 &end2, Double_t radius, Int_t nfaces=6, Bool_t closed=true) | |
| virtual | ~TridSketchTube () |
| void | DrawSelf (void) |
Public Attributes | |
| TVector3 * | p |
| Bool_t | fClosed |
| Int_t | fNfaces |
|
|
Definition at line 456 of file TridSketches.cxx. 00457 : TridSketch(kTube, TVector3() ) 00458 { 00459 // 00460 // Default constructor for a box. 00461 // 00462 p = new TVector3[6]; 00463 cout << "TridSketchTube:: Wrong constructor!" << endl; 00464 for(int i=0;i<8;i++) { 00465 cout << "Tube " << fId << "\t" << i << "\t" << p[i].x() << "\t" << p[i].y() << "\t" << p[i].z() << endl; 00466 } 00467 }
|
|
||||||||||||||||||||||||
|
Definition at line 470 of file TridSketches.cxx. References fClosed, fNfaces, and p. 00472 : TridSketch(kTube, (end1+end2)*0.5 ) 00473 { 00474 // 00475 // Defines the center of the faces, the 00476 // 00477 fNfaces = nfaces; 00478 fClosed = closed; 00479 p = new TVector3[nfaces*2]; 00480 00481 // Find the 2 vectors normal to the length of the tube. 00482 TVector3 v = end2-end1; 00483 TVector3 n1=v.Orthogonal(); 00484 TVector3 n2=v.Cross(n1); 00485 00486 n1.SetMag(1.0); 00487 n2.SetMag(1.0); 00488 00489 // Find the points around the ends. 00490 for(int i=0;i<fNfaces;i++) { 00491 double angle = (double)i/(double)fNfaces * 2.0*TMath::Pi(); 00492 p[i] = end1 + n1*cos(angle)*radius + n2*sin(angle)*radius; 00493 p[i+fNfaces] = end2 + n1*cos(angle)*radius + n2*sin(angle)*radius; 00494 } 00495 }
|
|
|
Definition at line 221 of file TridSketches.h. 00221 { delete [] p; };
|
|
|
Reimplemented from TridSketch. Definition at line 498 of file TridSketches.cxx. References fNfaces, TridSketch::GlVertexTVector(), MSG, and p. 00499 {
00500 //
00501 // Draws a box in the current context.
00502 //
00503 if(fClosed) {
00504 // Top Face
00505 glBegin(GL_POLYGON);
00506 for(int i=0;i<fNfaces;i++)
00507 GlVertexTVector(p[i]);
00508 glEnd();
00509
00510 // Bottom face
00511 glBegin(GL_POLYGON);
00512 for(int i=fNfaces;i<fNfaces*2;i++)
00513 GlVertexTVector(p[i]);
00514 glEnd();
00515 }
00516
00517 // Now do each face.
00518 glBegin(GL_QUAD_STRIP);
00519 for(int i=0;i<fNfaces+1;i++) { // Add an extra so we go all the way around.
00520 // Even and odd faces get get treated seperately.
00521 int iv1 = i%fNfaces;
00522 int iv2 = i%fNfaces + fNfaces;
00523 if((i%2)==0) {
00524 GlVertexTVector(p[iv1]);
00525 GlVertexTVector(p[iv2]);
00526 } else {
00527 GlVertexTVector(p[iv1]);
00528 GlVertexTVector(p[iv2]);
00529 }
00530 }
00531 glEnd();
00532
00533 int error;
00534 while ((error = glGetError()) != GL_NO_ERROR)
00535 MSG("TriD",Msg::kError) << "TridSketchTube::DrawSelf. GL error: "
00536 << "(" << error << ")"
00537 << gluErrorString(error)
00538 << endl;
00539 }
|
|
|
Definition at line 214 of file TridSketches.h. Referenced by TridSketchTube(). |
|
|
Definition at line 215 of file TridSketches.h. Referenced by DrawSelf(), and TridSketchTube(). |
|
|
Definition at line 213 of file TridSketches.h. Referenced by DrawSelf(), and TridSketchTube(). |
1.3.9.1