StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
StDraw3D Class Reference

Class StDraw3D - to draw the 3D primitives like 3D points and 3D lines decorated with the STAR detector geometry. More...

#include <StDraw3D.h>

Inheritance diagram for StDraw3D:
StuDraw3DEvent StuDraw3DMuEvent EveDis

Public Member Functions

 StDraw3D (const char *detectorName="TPC", TVirtualPad *pad=0)
 StDraw3D( const char *detectorName,TVirtualPad *pad) ctor. More...
 
 StDraw3D (TVirtualViewer3D *viewer, TVirtualPad *pad)
 This is an overloaded member function, provided for convenience. More...
 
virtual const StDraw3DStyleAddStyle (EDraw3DStyle type, Color_t col, Style_t sty, Size_t siz)
 Map the predefined style type to the ROOT graphical attributes col color sty style siz size. More...
 
TVirtualPad * Pad () const
 
TVirtualViewer3D * Viewer () const
 
virtual void Clear (Option_t *opt="update")
 Remove all objects from the list and update the screen if opt is "update".
 
virtual TObject * Draw (TObject *o, const char *option="")
 
virtual const TString & DetectorNames () const
 
virtual void SetDetectors (const char *nameDetectors)
 Set the list of the detector names to be used as the event "background". More...
 
virtual void AddDetectors (const char *nameDetectors)
 Append the detector names to the list of the event "background" shapes. More...
 
virtual void Draw (Option_t *option="")
 
virtual const StDraw3DStyleStyle (EDraw3DStyle type) const
 Return the reference to the predefined StDraw3DStyle object. More...
 
virtual StDraw3DStyleStyle (EDraw3DStyle type)
 
virtual void SetBkColor (Color_t newBkColor)
 Set the ROOT color as the widget background. More...
 
virtual TObject * Draw3D (int n, const float *xyz)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Draw3D (int n, const double *xyz)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Points (int n, const float *xyz, EDraw3DStyle sty)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Points (int n, const double *xyz, EDraw3DStyle sty)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Points (int n, const float *xyz, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
 Add n 3D coordinates from the xyz array to the display list with the col color, sty style, and siz size if provided. More...
 
virtual TObject * Points (int n, const double *xyz, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Points (const std::vector< float > &xyz, EDraw3DStyle sty)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Points (const std::vector< double > &xyz, EDraw3DStyle sty)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Points (const std::vector< float > &xyz, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Points (const std::vector< double > &xyz, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Point (float x, float y, float z, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
 
virtual TObject * Point (float x, float y, float z, EDraw3DStyle sty)
 
virtual TObject * Line (int n, const double *xyz, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Line (float x0, float y0, float z0, float x1, float y1, float z1, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Line (int n, const float *xyz, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
 Add n connected points defined by the "xyz" array of the 3D coordinates to the display list with the col color, sty style, and siz size if provided. More...
 
virtual TObject * Line (const std::vector< float > &xyz, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Line (const std::vector< double > &xyz, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Line (int n, const float *xyz, EDraw3DStyle sty)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Line (int n, const double *xyz, EDraw3DStyle sty)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Line (const std::vector< float > &xyz, EDraw3DStyle sty)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Line (const std::vector< double > &xyz, EDraw3DStyle sty)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Tower (float radius, float lambda, float lambda1, float lambda2, float phi, float dphi, Color_t col, Style_t sty, Size_t siz)
 This is an overloaded member function, provided for convenience. More...
 
virtual TObject * Tower (float radius, float lambda, float phi, float dlambda, float dphi, Color_t col, Style_t sty, Size_t siz)
 Draw the TTRAP object suitable to represent the calorimeter data. More...
 
virtual TObject * Tower (float radius, const StarRoot::StEta &eta, float phi, float dphi, Color_t col, Style_t sty, Size_t siz)
 This is an overloaded member function, provided for convenience. More...
 
virtual void Joint (StDraw3D *dsp)
 
virtual void SetModel (TObject *model)
 
virtual void SetComment (const char *cmnt)
 
virtual void AddComment (const char *cmnt)
 
virtual void Print (const char *filename) const
 Save the current 3D scene using "wrl" file format. More...
 
virtual void Print (const char *filename, const char *type) const
 This is an overloaded member function, provided for convenience. More...
 
virtual void Save (const char *filename, const char *type="png") const
 This is an overloaded member function, provided for convenience. More...
 
virtual void Update (bool asap=false)
 Render all items from the current display list onto the screen and refesh the screen immiately if asap is defined. More...
 
virtual void Modified ()
 
virtual void UpdateModified ()
 
virtual void SetDrawOption (Option_t *option="")
 Set the varous drawing option. The method passes the input options to TQtCoinWidget::SetDrawOption method. More...
 
virtual void SetFooter (const char *footer)
 Set the footer (caption) defined by the input footer text string. More...
 
virtual void Animate ()
 Animate the viewer from the gdb session. More...
 
void Draw3DTest ()
 The built-in quick test to check the application environment and test the basic methods. More...
 

Static Public Member Functions

static void ShowTest ()
 
static void ShowDetectorTest (const char *detectorName="StarDetectorUnfolding")
 

Protected Member Functions

virtual void UpdateViewer (TVirtualPad *pad=0)
 

Detailed Description

Class StDraw3D - to draw the 3D primitives like 3D points and 3D lines decorated with the STAR detector geometry.

Author
Valery Fine(fine@.nosp@m.bnl..nosp@m.gov)
Date
27/04/2008
See Also
Draw3D.C

Class provides the simple way to visualize the event primitives in 3D against of the STAR detector geometry quickly.


Try:

* > ln -s $STAR/StRoot/macros/.rootrc
* > root.exe Draw3D.C
*

to get the test picture below:

Draw3D.C.gif
Test image is to show several tpc points , tpc track, barrel and endcap towers
See Also
StDraw3D::Draw3DTest() The base StDraw3D class is a controller connecting the arbitrary "model" object with the arbitrary ROOT 3D class "view" object to implement the so-called "Model / View" paradigm.
In our case, the "Model" is an arbitrary object and the "View" is an instance of some ROOT 3D class. To render views the StDraw3D instantiates the TCanvas and TVirtualViewer3D to allow the user select interactively the "view" instance and invoke the model methods like:

Definition at line 165 of file StDraw3D.h.

Constructor & Destructor Documentation

StDraw3D::StDraw3D ( const char *  detectorName = "TPC",
TVirtualPad *  pad = 0 
)

StDraw3D( const char *detectorName,TVirtualPad *pad) ctor.

 \param detectorName (default = "TPC") - the names of the STAR detectors 
                                             to be used as the "event primitives" background.
                           The detectorName is a comma separated list of the OpenInventor files 
                           with no extension\n
                           For all names on the list one should provide the iv file with 
                           the "iv" extension:\n
<name>.iv
Parameters
detectorName= 0 - no detector geometry is to be rendered
pad(default = 0) - The ROOT TPad to be used to render the event wireframe view
Event over detector geometry Event with no detector geometry
Note
This is the base class for the advanced EventDisplay subclasses.
Normaly you do not need to instantiate StDraw3D directly.
StDraw class ctor defines the set of the pre-defines styles:
Style Color Style Size comment
kVtx kYellow 5 3.5 3D marker - vertex
kPrimaryTrack kRed 1 2.00 3D polyline - track
kGlobalTrack kRed 1 2.00 3D polyline - track
kTrackBegin kYellow 5 3.5 3D marker - vertex
kTrackEnd kYellow 5 3.5 3D marker - vertex
kUsedHit kBlue 4 0.35 3D marker - track start point
kUnusedHit kGreen 1 1.00 3D marker - track end point
See Also
http://root.cern.ch/root/html/TColor.html
http://root.cern.ch/root/html/TAttLine.html
http://root.cern.ch/root/html/TAttMarker.html

Definition at line 248 of file StDraw3D.cxx.

StDraw3D::StDraw3D ( TVirtualViewer3D *  viewer,
TVirtualPad *  pad 
)

This is an overloaded member function, provided for convenience.

Create a EventDisplay using the external TVirtualViewer3D viewer and TVirtualPad pad

Definition at line 276 of file StDraw3D.cxx.

Member Function Documentation

void StDraw3D::AddDetectors ( const char *  nameDetectors)
virtual

Append the detector names to the list of the event "background" shapes.

Parameters
nameDetectors- a comma separated list of the OpenInventor files with no extension
For all names on the list one should provide the iv file with the "iv" extension:
<name>.iv

Definition at line 382 of file StDraw3D.cxx.

const StDraw3DStyle & StDraw3D::AddStyle ( EDraw3DStyle  type,
Color_t  col,
Style_t  sty,
Size_t  siz 
)
virtual

Map the predefined style type to the ROOT graphical attributes col color sty style siz size.

Normally one does not need to call this method. All pre-defined styles are to be filled by StDraw3D class ctor

Parameters
type- The pre-define type we want to define
col- ROOT color attribute (See: http://root.cern.ch/root/html/TColor.html)
sty- ROOT style attribute. It can be either line http://root.cern.ch/root/html/TAttLine.html or marker http://root.cern.ch/root/html/TAttMarker.html
siz- ROOT graphical attribute size . It can be either line http://root.cern.ch/root/html/TAttLine.html or marker http://root.cern.ch/root/html/TAttMarker.html

Definition at line 469 of file StDraw3D.cxx.

References Style().

void StDraw3D::Animate ( )
virtual

Animate the viewer from the gdb session.

For example, use

gdb> p gEventDisplay->Point(0,0,0,1,1,1)

to add one 3D point to the plot followed by

gdb> p gEventDisplay->Animate();

to be able to interract with the display. To continue the debugger session select "option"->"Interrupt" menu

Definition at line 1624 of file StDraw3D.cxx.

References Pad(), and Update().

const TString & StDraw3D::DetectorNames ( ) const
virtual
Returns
The TString of the comma separated names

Definition at line 331 of file StDraw3D.cxx.

TObject * StDraw3D::Draw3D ( int  n,
const float *  xyz 
)
virtual

This is an overloaded member function, provided for convenience.

Add n 3D coordinates from the xyz array to the display list with the pre-defined kVtx style It is designed to be used from the interactive "gdb" session because it needs 2 parameters only it

Parameters
n- the number of the 3D coordinates
xyz- the pointer to the array of the floating point values ( the array should be 3*n long at least )
Returns
- a pointer to the ROOT "view" TPolyMarker3D created to render the input xyz array

Definition at line 686 of file StDraw3D.cxx.

References Points().

Referenced by Draw3DTest().

TObject * StDraw3D::Draw3D ( int  n,
const double *  xyz 
)
virtual

This is an overloaded member function, provided for convenience.

Add n 3D coordinates from the xyz array to the display list with the pre-defined kVtx style It is designed to be used from the interactive "gdb" session because it needs 2 parameters only it

Parameters
n- the number of the 3D coordinates
xyz- the pointer to the array of the floating point values ( the array should be 3*n long at least )
Returns
- a pointer to the ROOT "view" TPolyMarker3D created to render the input xyz array

Definition at line 707 of file StDraw3D.cxx.

References Points().

void StDraw3D::Draw3DTest ( )

The built-in quick test to check the application environment and test the basic methods.


Try:

> ln -s $STAR/StRoot/macros/.rootrc
> root.exe Draw3D.C

to get the picture:

Draw3D.C.png
Test image is to show several tpc points , tpc track, barrel and endcap towers
Draw3D.C.gif
Animated version of the test image

Definition at line 1178 of file StDraw3D.cxx.

References Draw3D(), Line(), Pad(), Tower(), and Update().

Referenced by Draw3D().

TObject * StDraw3D::Line ( int  n,
const double *  xyz,
Color_t  col = Color_t(-1),
Style_t  sty = Style_t(-1),
Size_t  siz = Size_t (-1) 
)
virtual

This is an overloaded member function, provided for convenience.

Add n connected points defined by the "xyz" array of the 3D coordinates to the display list with the col color, sty style, and siz size if provided

Parameters
n- the number of the 3D coordinates
xyz- the pointer to the array of the floating ount values ( the array should be 3*n long at least )
col- ROOT line color ( see: http://root.cern.ch/root/html/TAttLine.html )
sty- ROOT line style ( see: http://root.cern.ch/root/html/TAttLine.html )
siz- ROOT line width ( see: http://root.cern.ch/root/html/TAttLine.html )
Returns
- a pointer to the ROOT "view" TPolyLine3D created to render the input xyz array

Definition at line 807 of file StDraw3D.cxx.

Referenced by Draw3DTest(), Line(), StuDraw3DEvent::Track(), and StuDraw3DMuEvent::Track().

TObject * StDraw3D::Line ( float  x0,
float  y0,
float  z0,
float  x1,
float  y1,
float  z1,
Color_t  col = Color_t(-1),
Style_t  sty = Style_t(-1),
Size_t  siz = Size_t (-1) 
)
virtual

This is an overloaded member function, provided for convenience.

Add a line sigment connecting 2 points defined by the ("x0","y0" "z0") and ("x1","y1" "z1") to the display list with the col color, sty style, and siz size if provided

Parameters
x0,y0,z0- the 3D coordinates of the first point
x1,y1,z1- the 3D coordinates of the second point
col- ROOT line color ( see: http://root.cern.ch/root/html/TAttLine.html )
sty- ROOT line style ( see: http://root.cern.ch/root/html/TAttLine.html )
siz- ROOT line width ( see: http://root.cern.ch/root/html/TAttLine.html )
Returns
- a pointer to the ROOT "view" TPolyLine3D created to render the line segment defined by 2 input points

Definition at line 781 of file StDraw3D.cxx.

References Line().

TObject * StDraw3D::Line ( int  n,
const float *  xyz,
Color_t  col = Color_t(-1),
Style_t  sty = Style_t(-1),
Size_t  siz = Size_t (-1) 
)
virtual

Add n connected points defined by the "xyz" array of the 3D coordinates to the display list with the col color, sty style, and siz size if provided.

Parameters
n- the number of the 3D coordinates
xyz- the pointer to the array of the floating ount values ( the array should be 3*n long at least )
col- ROOT line color ( see: http://root.cern.ch/root/html/TAttLine.html )
sty- ROOT line style ( see: http://root.cern.ch/root/html/TAttLine.html )
siz- ROOT line width ( see: http://root.cern.ch/root/html/TAttLine.html )
Returns
- a pointer to the ROOT "view" TPolyLine3D created to render the input xyz array

Definition at line 755 of file StDraw3D.cxx.

TObject * StDraw3D::Line ( const std::vector< float > &  xyz,
Color_t  col = Color_t(-1),
Style_t  sty = Style_t(-1),
Size_t  siz = Size_t (-1) 
)
virtual

This is an overloaded member function, provided for convenience.

Add n connected points defined by the "xyz" array of the 3D coordinates to the display list with the col color, sty style, and siz size if provided

Parameters
xyz- the vector of the floating ount values ( the array should be 3*n long at least )
col- ROOT line color ( see: http://root.cern.ch/root/html/TAttLine.html )
sty- ROOT line style ( see: http://root.cern.ch/root/html/TAttLine.html )
siz- ROOT line width ( see: http://root.cern.ch/root/html/TAttLine.html )
Returns
- a pointer to the ROOT "view" TPolyLine3D created to render the input xyz array

Definition at line 831 of file StDraw3D.cxx.

References Line().

TObject * StDraw3D::Line ( const std::vector< double > &  xyz,
Color_t  col = Color_t(-1),
Style_t  sty = Style_t(-1),
Size_t  siz = Size_t (-1) 
)
virtual

This is an overloaded member function, provided for convenience.

Add n connected points defined by the "xyz" array of the 3D coordinates to the display list with the col color, sty style, and siz size if provided

Parameters
xyz- the vector of the floating ount values ( the array should be 3*n long at least )
col- ROOT line color ( see: http://root.cern.ch/root/html/TAttLine.html )
sty- ROOT line style ( see: http://root.cern.ch/root/html/TAttLine.html )
siz- ROOT line width ( see: http://root.cern.ch/root/html/TAttLine.html )
Returns
- a pointer to the ROOT "view" TPolyLine3D created to render the input xyz array

Definition at line 851 of file StDraw3D.cxx.

References Line().

TObject * StDraw3D::Line ( int  n,
const float *  xyz,
EDraw3DStyle  sty 
)
virtual

This is an overloaded member function, provided for convenience.

Add n connected points defined by the array of 3D coordinates to the display list with the sty pre-defined style if provided

Parameters
n- the number of the 3D coordinates
xyz- the pointer to the array of the floating ount values ( the array should be 3*n long at least )
sty- EDraw3DStyle value selecting some predefined style
Returns
- a pointer to the ROOT "view" TPolyLine3D created to render the input xyz array

Definition at line 912 of file StDraw3D.cxx.

References Line(), and Style().

TObject * StDraw3D::Line ( int  n,
const double *  xyz,
EDraw3DStyle  sty 
)
virtual

This is an overloaded member function, provided for convenience.

Add n connected points defined by the array of 3D coordinates to the display list with the sty pre-defined style if provided

Parameters
n- the number of the 3D coordinates
xyz- the pointer to the array of the floating ount values ( the array should be 3*n long at least )
sty- EDraw3DStyle value selecting some predefined style
Returns
- a pointer to the ROOT "view" TPolyLine3D created to render the input xyz array

Definition at line 934 of file StDraw3D.cxx.

References Line(), and Style().

TObject * StDraw3D::Line ( const std::vector< float > &  xyz,
EDraw3DStyle  sty 
)
virtual

This is an overloaded member function, provided for convenience.

Add the connected points defined by the vector of 3D coordinates to the display list with the sty pre-defined style if provided

Parameters
xyz- the vector of the floating ount values ( the array should be 3*n long at least )
sty- EDraw3DStyle value selecting some predefined style
Returns
- a pointer to the ROOT "view" TPolyLine3D created to render the input xyz array

Definition at line 869 of file StDraw3D.cxx.

References Line(), and Style().

TObject * StDraw3D::Line ( const std::vector< double > &  xyz,
EDraw3DStyle  sty 
)
virtual

This is an overloaded member function, provided for convenience.

Add the connected points defined by the vector of 3D coordinates to the display list with the sty pre-defined style if provided

Parameters
xyz- the vector of the floating ount values ( the array should be 3*n long at least )
sty- EDraw3DStyle value selecting some predefined style
Returns
- a pointer to the ROOT "view" TPolyLine3D created to render the input xyz array

Definition at line 890 of file StDraw3D.cxx.

References Line(), and Style().

TVirtualPad * StDraw3D::Pad ( ) const
Returns
The TPad pointer used to paint onto.

Definition at line 341 of file StDraw3D.cxx.

References Pad().

Referenced by Animate(), Clear(), Draw3DTest(), Pad(), Save(), SetBkColor(), and Update().

TObject * StDraw3D::Points ( int  n,
const float *  xyz,
EDraw3DStyle  sty 
)
virtual

This is an overloaded member function, provided for convenience.

Add n 3D coordinates from the xyz array to the display list with the sty pre-defined style if provided

Parameters
n- the number of the 3D coordinates
xyz- the pointer to the array of the floating point values ( the array should be 3*n long at least )
sty- EDraw3DStyle value selecting some predefined style
Returns
- a pointer to the ROOT "view" TPolyMarker3D created to render the input xyz array

Definition at line 596 of file StDraw3D.cxx.

References Style().

Referenced by Draw3D(), StuDraw3DEvent::Hits(), Points(), and StuDraw3DEvent::TrackInOut().

TObject * StDraw3D::Points ( int  n,
const double *  xyz,
EDraw3DStyle  sty 
)
virtual

This is an overloaded member function, provided for convenience.

Add n 3D coordinates from the xyz array to the display list with the sty pre-defined style if provided

Parameters
n- the number of the 3D coordinates
xyz- the pointer to the array of the floating point values ( the array should be 3*n long at least )
sty- EDraw3DStyle value selecting some predefined style
Returns
- a pointer to the ROOT "view" TPolyMarker3D created to render the input xyz array

Definition at line 619 of file StDraw3D.cxx.

References Points(), and Style().

TObject * StDraw3D::Points ( int  n,
const float *  xyz,
Color_t  col = Color_t(-1),
Style_t  sty = Style_t(-1),
Size_t  siz = Size_t (-1) 
)
virtual

Add n 3D coordinates from the xyz array to the display list with the col color, sty style, and siz size if provided.

Parameters
n- the number of the 3D coordinates
xyz- the pointer to the array of the floating ount values ( the array should be 3*n long at least )
col- ROOT line color ( see: http://root.cern.ch/root/html/TAttLine.html )
sty- ROOT line style ( see: http://root.cern.ch/root/html/TAttLine.html )
siz- ROOT line width ( see: http://root.cern.ch/root/html/TAttLine.html )
Returns
- a pointer to the ROOT "view" TPolyMarker3D created to render the input xyz array

Definition at line 504 of file StDraw3D.cxx.

TObject * StDraw3D::Points ( int  n,
const double *  xyz,
Color_t  col = Color_t(-1),
Style_t  sty = Style_t(-1),
Size_t  siz = Size_t (-1) 
)
virtual

This is an overloaded member function, provided for convenience.

Add n 3D coordinates from the xyz array of double values to the display list with the col color, sty style, and siz size if provided

Parameters
n- the number of the 3D coordinates
xyz- the pointer to the array of the floating ount values ( the array should be 3*n long at least )
col- ROOT line color ( see: http://root.cern.ch/root/html/TAttLine.html )
sty- ROOT line style ( see: http://root.cern.ch/root/html/TAttLine.html )
siz- ROOT line width ( see: http://root.cern.ch/root/html/TAttLine.html )
Returns
- a pointer to the ROOT "view" TPolyMarker3D created to render the input xyz array

Definition at line 531 of file StDraw3D.cxx.

TObject * StDraw3D::Points ( const std::vector< float > &  xyz,
EDraw3DStyle  sty 
)
virtual

This is an overloaded member function, provided for convenience.

Add 3D coordinates from the xyz vector to the display list with the sty pre-defined style if provided

Parameters
xyz- the vector of the floating point values ( the array should be 3*n long at least )
sty- EDraw3DStyle value selecting some predefined style
Returns
- a pointer to the ROOT "view" TPolyMarker3D created to render the input xyz array

Definition at line 641 of file StDraw3D.cxx.

References Points(), and Style().

TObject * StDraw3D::Points ( const std::vector< double > &  xyz,
EDraw3DStyle  sty 
)
virtual

This is an overloaded member function, provided for convenience.

Add 3D coordinates from the xyz vector to the display list with the sty pre-defined style if provided

Parameters
xyz- the vector of the floating point values ( the array should be 3*n long at least )
sty- EDraw3DStyle value selecting some predefined style
Returns
- a pointer to the ROOT "view" TPolyMarker3D created to render the input xyz array

Definition at line 663 of file StDraw3D.cxx.

References Points(), and Style().

TObject * StDraw3D::Points ( const std::vector< float > &  xyz,
Color_t  col = Color_t(-1),
Style_t  sty = Style_t(-1),
Size_t  siz = Size_t (-1) 
)
virtual

This is an overloaded member function, provided for convenience.

Add n 3D coordinates from the xyz array to the display list with the col color, sty style, and siz size if provided

Parameters
xyz- the vector of the floating ount values ( the container should be 3*n long at least )
col- ROOT line color ( see: http://root.cern.ch/root/html/TAttLine.html )
sty- ROOT line style ( see: http://root.cern.ch/root/html/TAttLine.html )
siz- ROOT line width ( see: http://root.cern.ch/root/html/TAttLine.html )
Returns
- a pointer to the ROOT "view" TPolyMarker3D created to render the input xyz array

Definition at line 557 of file StDraw3D.cxx.

References Points().

TObject * StDraw3D::Points ( const std::vector< double > &  xyz,
Color_t  col = Color_t(-1),
Style_t  sty = Style_t(-1),
Size_t  siz = Size_t (-1) 
)
virtual

This is an overloaded member function, provided for convenience.

Add n 3D coordinates from the xyz array to the display list with the col color, sty style, and siz size if provided

Parameters
xyz- the vector of the floating ount values ( the container should be 3*n long at least )
col- ROOT line color ( see: http://root.cern.ch/root/html/TAttLine.html )
sty- ROOT line style ( see: http://root.cern.ch/root/html/TAttLine.html )
siz- ROOT line width ( see: http://root.cern.ch/root/html/TAttLine.html )
Returns
- a pointer to the ROOT "view" TPolyMarker3D created to render the input xyz array

Definition at line 577 of file StDraw3D.cxx.

References Points().

void StDraw3D::Print ( const char *  filename) const
virtual

Save the current 3D scene using "wrl" file format.

Parameters
filename- the file name to save the 3d scene
Note
: The "wrl" format can be converted to the standatd 3D PDF format It can be done "Adobe 3D reviewer"

See examples:

You need to install the Adobe Reader version 9 or higher to be able to "click and see" the interactive ( zoom, pan, select / highlight the pieces, etc ) 3D image also

Definition at line 1032 of file StDraw3D.cxx.

References Save().

Referenced by Draw3D().

void StDraw3D::Print ( const char *  filename,
const char *  type 
) const
virtual

This is an overloaded member function, provided for convenience.

Save the current 3D scene using the type file format

Parameters
filename- the file name to save the 3d scene
type- the pre-defined file format. It can be 3D scene format like "wrl"/"iv" or the well-known pixmap formats like "pnd", "jpg" etc

Definition at line 1045 of file StDraw3D.cxx.

References Save().

void StDraw3D::Save ( const char *  filename,
const char *  type = "png" 
) const
virtual

This is an overloaded member function, provided for convenience.

Save the current 3D scene using the 3D "wrl" format if possible otherwise use the type file format

Parameters
filename- the file name to save the 3d scene
type- the pre-defined file format. It can be 3D scene format like "wrl"/"iv" or the well-known pixmap formats like "pnd", "jpg" etc

Definition at line 1059 of file StDraw3D.cxx.

References Pad(), and Viewer().

Referenced by Print().

void StDraw3D::SetBkColor ( Color_t  newBkColor)
virtual

Set the ROOT color as the widget background.

Parameters
newBkColor- ROOT index of the color to paint the widget backgorund (
See Also
http://root.cern.ch/root/html/TColor.html )

Definition at line 447 of file StDraw3D.cxx.

References Pad().

Referenced by Ed(), and EdMu().

void StDraw3D::SetDetectors ( const char *  nameDetectors)
virtual

Set the list of the detector names to be used as the event "background".

Parameters
nameDetectors- a comma separated list of the OpenInventor files with no extension
For all names on the list one should provide the iv file with the "iv" extension:
<name>.iv

Definition at line 362 of file StDraw3D.cxx.

void StDraw3D::SetDrawOption ( Option_t *  options = "")
virtual

Set the varous drawing option. The method passes the input options to TQtCoinWidget::SetDrawOption method.

Parameters
options- [ <shape1> [, shape2 [, . . . shape-n] - a comma separated list of the OpenInventor files with no extension
| { parameter : value } - enclosed into the curly brackets a pair "parameter : value"
- { file : file.iv } - the iv file defining the top level OpenInventor node. For example, it can be useful to customize the entire screen rotation / animation )
-{ footer: text } - define the image footer (caption)
-{ record : true | false } - toogle the "record scene" option
-{ save : filename } - save the current image into file
-{ screen : full } - turn the "fullscreen view" option
-{ view : all } - zoom the image in/out to make sure it fits the entire screen

For example, the ROOT macro:

void Draw3D()
{
gROOT->Macro("Load.C"); //< Load STAR framework shared libraries
gEventDisplay->Draw3DTest(); //< Invoke the built-in rendering test
gEventDisplay->SetDrawOption("{file:rotation.iv}");//< Add rotation to the scene
gEventDisplay->SetFooter("STAR Event Display Example");
gEventDisplay->Print("Draw3DTest.wrl"); //< Save the 3D scene into the file
gEventDisplay->SetDrawOption("{view:all}"); // zoom the scene in/out to fit the entire screen
}

is to produce the animated image:

Draw3D.C.gif
Animated version of the test image
See Also
Draw3D.C

Definition at line 1097 of file StDraw3D.cxx.

References Viewer().

Referenced by Draw3D(), EdMu(), mae(), and SetFooter().

void StDraw3D::SetFooter ( const char *  footer)
virtual

Set the footer (caption) defined by the input footer text string.

Parameters
footer- the text string to be drawn onto the bottom of the 3D scene image. The string may contain sevral lines separated by \n end-of-line symbol

Definition at line 1603 of file StDraw3D.cxx.

References SetDrawOption().

Referenced by Draw3D().

const StDraw3DStyle & StDraw3D::Style ( EDraw3DStyle  type) const
virtual

Return the reference to the predefined StDraw3DStyle object.

Parameters
type- The pre-defined type we want to get the reference to

Definition at line 482 of file StDraw3D.cxx.

Referenced by AddStyle(), addTracks(), StuDraw3DEvent::Hit(), StuDraw3DEvent::Hits(), Line(), Points(), StuDraw3DEvent::Track(), StuDraw3DMuEvent::Track(), StuDraw3DMuEvent::TrackInOut(), StuDraw3DEvent::TrackInOut(), StuDraw3DMuEvent::Tracks(), and StuDraw3DEvent::Vertex().

TObject * StDraw3D::Tower ( float  radius,
float  lambda,
float  lambda1,
float  lambda2,
float  phi,
float  dphi,
Color_t  col,
Style_t  sty,
Size_t  siz 
)
virtual

This is an overloaded member function, provided for convenience.

The method creates one "tower" object (see:  http://root.cern.ch/root/html/TTRAP.html#TTRAP:description )
Parameters
radius- the distance between the base of the tower and the "origin". It can be either the distance from the Z-axis for the kBarrelStyle or the distance from the xy plane for EndCap tower (default) style, for example.
lambda- the tower direction (in rads). It is the angle in respect of the Y-axis for kBarrelStyle tower or Z-axis.
lambda1- the tower near edge (in rads)
lambda2- the tower far edge (in rads)
phi- the angle (in rads) in XY plane against of the Ox
dphi- the non-negative angle "length" of the tower
col- ROOT fill color ( see: http://root.cern.ch/root/html/TAttFill.html )
sty- ROOT fill style ( see: http://root.cern.ch/root/html/TAttFIll.html ) The default style is "Endcap". One can add kBarrelStyle constant to ROOT style to get the "barrel" style tower
= 0 - solid color, 4001 - wireframe view, 4001 ... 4100 - solid translucent color from 99% transparent to 100% opaque
siz- the height of the tower. It can be used to visualize the energy deposit or for any other reason.
Returns
- a pointer to the ROOT "view" TVolume created to render the input parameters.
Explanation of the StDraw::Tower(...) method parameters ("barrel" style )
XZ plane view XY plane view
Explanation of the StDraw::Tower(...) method parameters (default "endcap" style )
XZ plane view XY plane view

Definition at line 1425 of file StDraw3D.cxx.

Referenced by Draw3DTest(), StuDraw3DMuEvent::EmcHit(), StuDraw3DEvent::EmcHit(), StuDraw3DMuEvent::Endcaps(), and Tower().

TObject * StDraw3D::Tower ( float  radius,
float  lambda,
float  phi,
float  dlambda,
float  dphi,
Color_t  col,
Style_t  sty,
Size_t  siz 
)
virtual

Draw the TTRAP object suitable to represent the calorimeter data.

The method creates one "tower" object (see:  http://root.cern.ch/root/html/TTRAP.html#TTRAP:description )
Parameters
radius- the distance between the base of the tower and the "origin". It can be either the distance from the Z-axis for the kBarrelStyle or the distance from the xy plane for EndCap tower (default) style, for example.
lambda- the tower direction (in rads). It is the angle in respect of the Y-axis for kBarrelStyle tower or Z-axis.
phi- the angle (in rads) in XY plane against of the Ox
dlambda- the non-negative angle "width" of the tower.
dphi- the non-negative angle "length" of the tower
col- ROOT fill color ( see: http://root.cern.ch/root/html/TAttFill.html )
sty- ROOT fill style ( see: http://root.cern.ch/root/html/TAttFIll.html ) The default style is "Endcap". One can add kBarrelStyle constant to ROOT style to get the "barrel" style tower
= 0 - solid color, 4001 - wireframe view, 4001 ... 4100 - solid translucent color from 99% transparent to 100% opaque
siz- the height of the tower. It can be used to visualize the energy deposit or for any other reason.
Returns
- a pointer to the ROOT "view" TVolume created to render the input parameters.
Explanation of the StDraw::Tower(...) method parameters ("barrel" style )
XZ plane view XY plane view
Explanation of the StDraw::Tower(...) method parameters (default "endcap" style )
XZ plane view XY plane view

Definition at line 1374 of file StDraw3D.cxx.

References Tower().

TObject * StDraw3D::Tower ( float  radius,
const StarRoot::StEta eta,
float  phi,
float  dphi,
Color_t  col,
Style_t  sty,
Size_t  siz 
)
virtual

This is an overloaded member function, provided for convenience.

The method creates one "tower" object (see:  http://root.cern.ch/root/html/TTRAP.html#TTRAP:description )
Parameters
radius- the distance between the base of the tower and the "origin". It can be either the distance from the Z-axis for the kBarrelStyle or the distance from the xy plane for Endcap towers (default), for example.
eta(eta,dEta) - the tower direction eta and width dEta (in eta units). (See: http://en.wikipedia.org/wiki/Pseudorapidity )
phi- the angle (in rads) in XY plane against of the Ox
dphi- the non-negative angle "length" of the tower
col- ROOT fill color ( see: http://root.cern.ch/root/html/TAttFill.html )
sty- ROOT fill style ( see: http://root.cern.ch/root/html/TAttFill.html ) one can add kBarrelStyle constant to ROOT style to get the "barrel" style tower
= 0 - solid color, 4001 - wireframe view, 4001 ... 4100 - solid translucent color from 99% transparent to 100% opaque
siz- the height of the tower. It can be used to visualize the energy deposit or for any other reason.
Returns
- a pointer to the ROOT "view" TVolume created to render the input parameters.
Explanation of the StDraw::Tower(...) method parameters ("barrel" style )
XZ plane view XY plane view
Explanation of the StDraw::Tower(...) method parameters (default "endcap" style )
XZ plane view XY plane view

Definition at line 1580 of file StDraw3D.cxx.

References Tower().

void StDraw3D::Update ( bool  asap = false)
virtual

Render all items from the current display list onto the screen and refesh the screen immiately if asap is defined.

Parameters
asap= (defaul:false) force the sysysten to refresh the screen woith the fresh image. This option can significantly slow dowbn the rednereing if abused.

Definition at line 1109 of file StDraw3D.cxx.

References Pad().

Referenced by Animate(), Clear(), and Draw3DTest().

TVirtualViewer3D * StDraw3D::Viewer ( ) const
Returns
The TVirtualViewer3D viewer pointer used to render into.

Definition at line 349 of file StDraw3D.cxx.

References Viewer().

Referenced by Clear(), Save(), SetDrawOption(), and Viewer().


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