TridSketchLine Class Reference

#include <TridSketches.h>

Inheritance diagram for TridSketchLine:
TridSketch

List of all members.

Public Member Functions

 TridSketchLine (float x1=0, float y1=0, float z1=0, float x2=0, float y2=0, float z2=0)
 TridSketchLine (const TVector3 &inp1, const TVector3 &inp2)
 TridSketchLine (const TVector3 &x0, const TVector3 &v1, float half_length)
 ~TridSketchLine (void)
void SetPoint (int ipoint, const TVector3 &pt)
void SetPoint (int ipoint, float x, float y, float z)
void SetWidth (float width)
void SetStipple (int stipple)
void DrawSelf (void)
 ClassDef (TridSketchLine, 1) float fWidth

Public Attributes

TVector3 p [2]
int fStipple

Detailed Description

Definition at line 123 of file TridSketches.h.


Constructor & Destructor Documentation

TridSketchLine::TridSketchLine ( float  x1 = 0,
float  y1 = 0,
float  z1 = 0,
float  x2 = 0,
float  y2 = 0,
float  z2 = 0 
)

Definition at line 138 of file TridSketches.cxx.

00139   : TridSketch(kLine, TVector3((x1+x2)*0.5,(y1+y2)*0.5,(z1+z2)*0.5) )
00140   , fWidth(1.0), fStipple(-1)
00141 {
00142   //
00143   // Defines a line using the x,y,z coords of the two endpoints.
00144   //
00145   p[0].SetXYZ(x1,y1,z1);
00146   p[1].SetXYZ(x2,y2,z2);
00147 }

TridSketchLine::TridSketchLine ( const TVector3 &  inp1,
const TVector3 &  inp2 
)

Definition at line 149 of file TridSketches.cxx.

References p.

00150   : TridSketch( kLine, (inp1 + inp2)*0.5 )
00151   , fWidth(1.0), fStipple(-1)
00152 {
00153   //
00154   // Defines a line using 3-vectors of the two endpoints.
00155   //
00156   p[0] = inp1;
00157   p[1] = inp2;
00158 }

TridSketchLine::TridSketchLine ( const TVector3 &  x0,
const TVector3 &  v1,
float  half_length 
)

Definition at line 160 of file TridSketches.cxx.

References p.

00161   : TridSketch( kLine, x0 )
00162   , fWidth(1.0), fStipple(-1)
00163 {
00164   // 
00165   // Defines a line using the 3-vector of the center point, the direciton vector,
00166   // and the half length.
00167   //
00168   p[0] = x0+(v1*half_length);
00169   p[1] = x0-(v1*half_length);
00170 }

TridSketchLine::~TridSketchLine ( void   )  [inline]

Definition at line 132 of file TridSketches.h.

00132 {};


Member Function Documentation

TridSketchLine::ClassDef ( TridSketchLine  ,
 
)
void TridSketchLine::DrawSelf ( void   )  [virtual]

Reimplemented from TridSketch.

Definition at line 172 of file TridSketches.cxx.

References fStipple, TridSketch::GlVertexTVector(), Msg::kError, MSG, and p.

00173 {
00174   // Draws a line in the current OpenGL context.
00175 
00176   glLineWidth(fWidth);
00177   if(fStipple>0) {
00178     glLineStipple(fStipple, 0xAAAA);
00179     glEnable(GL_LINE_STIPPLE);    
00180   }
00181   glBegin(GL_LINES);
00182   GlVertexTVector( p[0] );
00183   GlVertexTVector( p[1] );
00184   glEnd();
00185   glLineWidth(1.0);
00186   if(fStipple>0) {
00187     glDisable(GL_LINE_STIPPLE);    
00188   }
00189   
00190   int error;
00191   while ((error = glGetError()) != GL_NO_ERROR)  
00192     MSG("TriD",Msg::kError) << "TridSketchLine::DrawSelf.  GL error: "
00193                             << "(" << error << ")"
00194                             <<  gluErrorString(error)
00195                             << endl;
00196 
00197 }

void TridSketchLine::SetPoint ( int  ipoint,
float  x,
float  y,
float  z 
) [inline, virtual]

Reimplemented from TridSketch.

Definition at line 135 of file TridSketches.h.

References p, and TridSketch::SetDirty().

00135 { p[ipoint].SetXYZ(x,y,z);  SetDirty(); };

void TridSketchLine::SetPoint ( int  ipoint,
const TVector3 &  pt 
) [inline, virtual]

Reimplemented from TridSketch.

Definition at line 134 of file TridSketches.h.

References p, and TridSketch::SetDirty().

00134 { p[ipoint] = pt;  SetDirty();};

void TridSketchLine::SetStipple ( int  stipple  )  [inline]

Definition at line 137 of file TridSketches.h.

References fStipple.

00137 { fStipple = stipple; };

void TridSketchLine::SetWidth ( float  width  )  [inline]

Definition at line 136 of file TridSketches.h.

00136 { fWidth = width; };


Member Data Documentation

Definition at line 142 of file TridSketches.h.

Referenced by DrawSelf(), and SetStipple().

TVector3 TridSketchLine::p[2]

The documentation for this class was generated from the following files:

Generated on 15 Jul 2018 for loon by  doxygen 1.6.1