TridSketch Class Reference

#include <TridSketches.h>

Inheritance diagram for TridSketch:
TridSketch3Prism TridSketchBox TridSketchEllipse TridSketchLine TridSketchPlane TridSketchText TridSketchTube

List of all members.

Public Types

enum  ETridSketchTypes {
  kNull = 0, kLine, kPlane, kBox,
  k3Prism, kTube, kEllipse, kText
}

Public Member Functions

 TridSketch (int type, TVector3 center=TVector3(0, 0, 0))
 ~TridSketch (void)
int GetType (void)
unsigned int GetId (void)
float GetTransparency (void)
void GetColorRGB (float &r, float &g, float &b)
TVector3 GetColor ()
double GetTime ()
Bool_t IsDrawn ()
Bool_t IsScenery ()
void SetColor (float red, float green, float blue)
void SetColor (const TColor &color)
void SetColor (const TVector3 &color)
void SetTransparency (float trans)
void SetTime (double time)
void SetDrawn (bool on=true)
void SetScenery (bool on=true)
virtual void SetPoint (int, const TVector3 &)
virtual void SetPoint (int, float, float, float)
virtual void SetDirty (void)
virtual Bool_t Draw (double timestart=-1e99, double timeend=1e99)
virtual double ComputeApparentZ (double *modelViewMatrix)
virtual double GetApparentZ ()

Static Public Member Functions

static void SetDefaultColor (float red, float green, float blue)
static void SetDefaultColor (const TColor &color)
static void SetDefaultColor (TVector3 &color)
static void SetDefaultTrans (float trans)
static void StartScenery ()
static void StopScenery ()

Protected Member Functions

void GlVertexTVector (TVector3 &vect)
virtual void DrawSelf (void)

Protected Attributes

int fType
unsigned int fId
TVector3 fColor
float fTransparency
bool fHighlighted
bool fToggle
bool fScenery
double fTime
int fCallList
TVector3 fCenter
double fApparentZ

Static Protected Attributes

static unsigned int fgSketchIdCounter = 1
static TVector3 fgDefaultColor = TVector3( 1,1,1 )
static float fgDefaultTrans = 1.0
static Bool_t fgScenery = false

Private Member Functions

 TridSketch (void)
void Draw (Option_t *)

Detailed Description

Definition at line 38 of file TridSketches.h.


Member Enumeration Documentation

Enumerator:
kNull 
kLine 
kPlane 
kBox 
k3Prism 
kTube 
kEllipse 
kText 

Definition at line 80 of file TridSketches.h.

00080                        {
00081     kNull = 0,
00082     kLine,
00083     kPlane,
00084     kBox,
00085     k3Prism,
00086     kTube,
00087     kEllipse,
00088     kText
00089   };


Constructor & Destructor Documentation

TridSketch::TridSketch ( int  type,
TVector3  center = TVector3(0,0,0) 
)

Definition at line 27 of file TridSketches.cxx.

00027                                                   :
00028   fType( type ),
00029   fHighlighted( false ),
00030   fToggle( true ),
00031   fScenery( fgScenery ),
00032   fTime( -999. ),
00033   fCallList( 0 ),
00034   fCenter( center )
00035 {
00036   // Default constructor for base clase. 
00037   //
00038   fId = fgSketchIdCounter;
00039   fgSketchIdCounter++;
00040 
00041   fColor = fgDefaultColor;
00042   fTransparency = fgDefaultTrans;
00043 }

TridSketch::~TridSketch ( void   ) 

Definition at line 62 of file TridSketches.cxx.

References fCallList.

00063 {
00064   glDeleteLists(fCallList,1);
00065 }

TridSketch::TridSketch ( void   )  [inline, private]

Definition at line 116 of file TridSketches.h.

00116 {};


Member Function Documentation

double TridSketch::ComputeApparentZ ( double *  modelViewMatrix  )  [virtual]

Definition at line 123 of file TridSketches.cxx.

References fApparentZ, and fCenter.

Referenced by TridGLFrame::DrawObjects().

00124 {
00125   fApparentZ = 
00126     modelViewMatrix[2] *fCenter.x() +
00127     modelViewMatrix[6] *fCenter.y() +
00128     modelViewMatrix[10]*fCenter.z()*10000.;  
00129   return fApparentZ;
00130 }

void TridSketch::Draw ( Option_t *   )  [inline, private]

Definition at line 117 of file TridSketches.h.

00117 {};

Bool_t TridSketch::Draw ( double  timestart = -1e99,
double  timeend = 1e99 
) [virtual]

Definition at line 75 of file TridSketches.cxx.

References DrawSelf(), fCallList, fColor, fId, fScenery, fTime, fToggle, fTransparency, Msg::kWarning, and MSG.

Referenced by TridGLFrame::DrawObjects(), TridHistoGLFrame::DrawObjects(), and TridFlatGLFrame::DrawObjects().

00076 {
00077   // Interface to specific drawing routines.
00078   // Handles some things common to all sketches.
00079 
00080   // Returns true if something actually got drawn.
00081   if(fToggle) {
00082     if( (fScenery) || // Scenery is always drawn
00083         ( ( fTime >= timestart ) && ( fTime < timeend ) ) // Other things get time-chopped.
00084         ) {
00085       
00086       // Change color:
00087       glColor4f(fColor.x(),fColor.y(),fColor.z(),fTransparency);
00088       
00089       if(fCallList == 0) {
00090         // Create the cached draw commands.
00091         fCallList = glGenLists(1);
00092         if(fCallList) {
00093           glNewList(fCallList,GL_COMPILE_AND_EXECUTE);
00094           glLoadName(fId);      
00095           this->DrawSelf();
00096           glEndList();
00097         } else {
00098           glLoadName(fId);
00099           this->DrawSelf();
00100           // Call list was not generated.. create an error
00101           MSG("TriD",Msg::kWarning) << "OpenGL problem: Could not create a new display list." << endl;
00102         }
00103       } else {
00104         glCallList(fCallList);
00105       }
00106       
00107       return true;
00108       
00109     }
00110   }
00111   return false;
00112 }

virtual void TridSketch::DrawSelf ( void   )  [inline, protected, virtual]

Reimplemented in TridSketchLine, TridSketchPlane, TridSketchBox, TridSketch3Prism, TridSketchTube, TridSketchEllipse, and TridSketchText.

Definition at line 112 of file TridSketches.h.

Referenced by Draw().

00112 {};

virtual double TridSketch::GetApparentZ (  )  [inline, virtual]

Definition at line 69 of file TridSketches.h.

References fApparentZ.

00069 {return fApparentZ;};

TVector3 TridSketch::GetColor (  )  [inline]

Definition at line 49 of file TridSketches.h.

References fColor.

00049 { return fColor; };

void TridSketch::GetColorRGB ( float &  r,
float &  g,
float &  b 
) [inline]

Definition at line 48 of file TridSketches.h.

References fColor.

00048 { r=fColor.x(); g=fColor.y(); b=fColor.z(); }; 

unsigned int TridSketch::GetId ( void   )  [inline]
double TridSketch::GetTime ( void   )  [inline]

Definition at line 50 of file TridSketches.h.

References fTime.

00050 { return fTime; };

float TridSketch::GetTransparency ( void   )  [inline]

Definition at line 47 of file TridSketches.h.

References fTransparency.

Referenced by TridGLFrame::DrawObjects().

00047 { return fTransparency; };

int TridSketch::GetType ( void   )  [inline]

Definition at line 45 of file TridSketches.h.

References fType.

00045 { return fType; };

void TridSketch::GlVertexTVector ( TVector3 &  vect  )  [protected]

Definition at line 115 of file TridSketches.cxx.

Referenced by TridSketchPlane::DrawSelf(), TridSketch3Prism::DrawSelf(), TridSketchBox::DrawSelf(), TridSketchEllipse::DrawSelf(), TridSketchLine::DrawSelf(), and TridSketchTube::DrawSelf().

00116 {
00117   //
00118   // Orders a glVertex given a ROOT 3-vector
00119   //
00120   glVertex3d(vect.x(), vect.y(), vect.z() );
00121 }

Bool_t TridSketch::IsDrawn (  )  [inline]

Definition at line 51 of file TridSketches.h.

References fToggle.

00051 { return fToggle; };

Bool_t TridSketch::IsScenery (  )  [inline]

Definition at line 52 of file TridSketches.h.

References fScenery.

00052 { return fScenery; };

void TridSketch::SetColor ( const TVector3 &  color  )  [inline]

Definition at line 56 of file TridSketches.h.

References fColor.

00056 { fColor = color; };

void TridSketch::SetColor ( const TColor &  color  )  [inline]

Definition at line 55 of file TridSketches.h.

References fColor.

00055 { fColor.SetXYZ(color.GetRed(),color.GetGreen(),color.GetBlue()); };

void TridSketch::SetColor ( float  red,
float  green,
float  blue 
) [inline]
static void TridSketch::SetDefaultColor ( TVector3 &  color  )  [inline, static]

Definition at line 73 of file TridSketches.h.

References fgDefaultColor.

00073 { fgDefaultColor = color; };

static void TridSketch::SetDefaultColor ( const TColor &  color  )  [inline, static]

Definition at line 72 of file TridSketches.h.

References fgDefaultColor.

00072 { fgDefaultColor.SetXYZ(color.GetRed(),color.GetGreen(),color.GetBlue()); }; 

static void TridSketch::SetDefaultColor ( float  red,
float  green,
float  blue 
) [inline, static]
static void TridSketch::SetDefaultTrans ( float  trans  )  [inline, static]

Definition at line 74 of file TridSketches.h.

References fgDefaultTrans.

Referenced by TridHistoGLFrame::DrawObjects().

00074 { fgDefaultTrans = trans; };

void TridSketch::SetDirty ( void   )  [virtual]
void TridSketch::SetDrawn ( bool  on = true  )  [inline]

Definition at line 59 of file TridSketches.h.

References fToggle.

Referenced by TridPmtPage::ModifySketches().

00059 { fToggle = on; };

virtual void TridSketch::SetPoint ( int  ,
float  ,
float  ,
float   
) [inline, virtual]

Reimplemented in TridSketchLine, TridSketchPlane, TridSketchBox, and TridSketch3Prism.

Definition at line 63 of file TridSketches.h.

00063 {};

virtual void TridSketch::SetPoint ( int  ,
const TVector3 &   
) [inline, virtual]

Reimplemented in TridSketchLine, TridSketchPlane, TridSketchBox, and TridSketch3Prism.

Definition at line 62 of file TridSketches.h.

00062 {};

void TridSketch::SetScenery ( bool  on = true  )  [inline]

Definition at line 60 of file TridSketches.h.

References fScenery.

00060 { fScenery = on; };

void TridSketch::SetTime ( double  time  )  [inline]
void TridSketch::SetTransparency ( float  trans  )  [inline]
static void TridSketch::StartScenery (  )  [inline, static]
static void TridSketch::StopScenery (  )  [inline, static]

Member Data Documentation

double TridSketch::fApparentZ [protected]

Definition at line 105 of file TridSketches.h.

Referenced by ComputeApparentZ(), and GetApparentZ().

int TridSketch::fCallList [protected]

Definition at line 103 of file TridSketches.h.

Referenced by Draw(), SetDirty(), and ~TridSketch().

TVector3 TridSketch::fCenter [protected]

Definition at line 104 of file TridSketches.h.

Referenced by ComputeApparentZ(), and TridSketchPlane::TridSketchPlane().

TVector3 TridSketch::fColor [protected]

Definition at line 97 of file TridSketches.h.

Referenced by Draw(), GetColor(), GetColorRGB(), and SetColor().

TVector3 TridSketch::fgDefaultColor = TVector3( 1,1,1 ) [static, protected]

Definition at line 108 of file TridSketches.h.

Referenced by SetDefaultColor().

float TridSketch::fgDefaultTrans = 1.0 [static, protected]

Definition at line 109 of file TridSketches.h.

Referenced by SetDefaultTrans().

Bool_t TridSketch::fgScenery = false [static, protected]

Definition at line 110 of file TridSketches.h.

Referenced by StartScenery(), and StopScenery().

unsigned int TridSketch::fgSketchIdCounter = 1 [static, protected]

Definition at line 107 of file TridSketches.h.

bool TridSketch::fHighlighted [protected]

Definition at line 99 of file TridSketches.h.

unsigned int TridSketch::fId [protected]

Definition at line 96 of file TridSketches.h.

Referenced by Draw(), and GetId().

bool TridSketch::fScenery [protected]

Definition at line 101 of file TridSketches.h.

Referenced by Draw(), IsScenery(), and SetScenery().

double TridSketch::fTime [protected]

Definition at line 102 of file TridSketches.h.

Referenced by Draw(), GetTime(), and SetTime().

bool TridSketch::fToggle [protected]

Definition at line 100 of file TridSketches.h.

Referenced by Draw(), IsDrawn(), and SetDrawn().

float TridSketch::fTransparency [protected]

Definition at line 98 of file TridSketches.h.

Referenced by Draw(), GetTransparency(), and SetTransparency().

int TridSketch::fType [protected]

Definition at line 95 of file TridSketches.h.

Referenced by GetType().


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

Generated on 24 Jul 2018 for loon by  doxygen 1.6.1