LDMX Software
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
eventdisplay::EveShapeDrawer Class Reference

Helper class for drawing common shapes. More...

#include <EveShapeDrawer.h>

Public Member Functions

TEveGeoShape * drawHexPrism (Double_t xPos, Double_t yPos, Double_t zPos, Double_t xRot, Double_t yRot, Double_t zRot, Double_t h, Double_t r, Int_t color, Int_t transparency, TString name)
 Draw a hexagonal prism.
 
TEveGeoShape * drawHexPrism (HexPrism prism, Double_t xRot, Double_t yRot, Double_t zRot, Int_t color, Int_t transparency, TString name)
 Draw a hexagonal prism.
 
TEveGeoShape * drawRectPrism (Double_t xPos, Double_t yPos, Double_t zPos, Double_t dX, Double_t dY, Double_t dZ, Double_t xRot, Double_t yRot, Double_t zRot, Int_t color, Int_t transparency, TString name)
 Draw a rectangular prism.
 
TEveGeoShape * drawRectPrism (BoundingBox boundingbox, Double_t xRot, Double_t yRot, Double_t zRot, Int_t color, Int_t transparency, TString name)
 Draw a rectangular prism.
 

Static Public Member Functions

static EveShapeDrawergetInstance ()
 Get Instance of Drawer.
 

Private Attributes

UInt_t uid_ = 0
 

Detailed Description

Helper class for drawing common shapes.

Definition at line 27 of file EveShapeDrawer.h.

Member Function Documentation

◆ drawHexPrism() [1/2]

TEveGeoShape * eventdisplay::EveShapeDrawer::drawHexPrism ( Double_t  xPos,
Double_t  yPos,
Double_t  zPos,
Double_t  xRot,
Double_t  yRot,
Double_t  zRot,
Double_t  h,
Double_t  r,
Int_t  color,
Int_t  transparency,
TString  name 
)
inline

Draw a hexagonal prism.

Parameters
xPosx coordinate for center of prism [mm]
yPosy coordinate for center of prism [mm]
zPosz coordinate for center of prism [mm]
xRotrotation around x-axis [degrees]
yRotrotation around y-axis [degrees]
zRotrotation around z-axis [degrees]
hheight of prism [mm]
rradius of prism (center to corner) [mm]
colorcolor of prism
transparencytransparency of prism
namename of prism

Definition at line 52 of file EveShapeDrawer.h.

55 {
56 TGeoCombiTrans* locAndOrien = new TGeoCombiTrans(
57 xPos, yPos, zPos, new TGeoRotation(name, xRot, yRot, zRot));
58
59 TEveGeoShape* hexPrism = new TEveGeoShape(name);
60 TGeoShape* tube = new TGeoTube(name, 0, r, h / 2);
61 tube->SetUniqueID(uid_++);
62 hexPrism->SetShape(tube);
63 hexPrism->SetFillColor(color);
64 hexPrism->SetMainTransparency(transparency);
65 hexPrism->SetNSegments(6);
66 hexPrism->SetTransMatrix(*locAndOrien);
67
68 return hexPrism;
69 }

Referenced by eventdisplay::Objects::draw(), eventdisplay::Objects::draw(), eventdisplay::Objects::draw(), eventdisplay::EveDetectorGeometry::drawECAL(), and drawHexPrism().

◆ drawHexPrism() [2/2]

TEveGeoShape * eventdisplay::EveShapeDrawer::drawHexPrism ( HexPrism  prism,
Double_t  xRot,
Double_t  yRot,
Double_t  zRot,
Int_t  color,
Int_t  transparency,
TString  name 
)
inline

Draw a hexagonal prism.

Parameters
HexPrismdescription of hexagonal prism geometry
xRotrotation around x-axis [degrees]
yRotrotation around y-axis [degrees]
zRotrotation around z-axis [degrees]
colorcolor of prism
transparencytransparency of prism
namename of prism

Definition at line 82 of file EveShapeDrawer.h.

84 {
85 return drawHexPrism(prism.x, prism.y, prism.z, xRot, yRot, zRot,
86 prism.height, prism.radius, color, transparency, name);
87 }
TEveGeoShape * drawHexPrism(Double_t xPos, Double_t yPos, Double_t zPos, Double_t xRot, Double_t yRot, Double_t zRot, Double_t h, Double_t r, Int_t color, Int_t transparency, TString name)
Draw a hexagonal prism.

References drawHexPrism().

◆ drawRectPrism() [1/2]

TEveGeoShape * eventdisplay::EveShapeDrawer::drawRectPrism ( BoundingBox  boundingbox,
Double_t  xRot,
Double_t  yRot,
Double_t  zRot,
Int_t  color,
Int_t  transparency,
TString  name 
)
inline

Draw a rectangular prism.

Parameters
boundingboxcontaining description of rectangular prism
xRotrotation around x-axis [degrees]
yRotrotation around y-axis [degrees]
zRotrotation around z-axis [degrees]
colorcolor of prism
transparencytransparency of prism
namename of prism

Definition at line 134 of file EveShapeDrawer.h.

136 {
137 std::vector<double> center(3, 0);
138 std::vector<double> widths(3, 0);
139
140 for (unsigned int iC = 0; iC < 3; iC++) {
141 center[iC] = (boundingbox[iC].second + boundingbox[iC].first) / 2.0;
142 widths[iC] = abs(boundingbox[iC].second - boundingbox[iC].first);
143 }
144
145 return drawRectPrism(center[0], center[1], center[2], widths[0], widths[1],
146 widths[2], xRot, yRot, zRot, color, transparency,
147 name);
148 }
TEveGeoShape * drawRectPrism(Double_t xPos, Double_t yPos, Double_t zPos, Double_t dX, Double_t dY, Double_t dZ, Double_t xRot, Double_t yRot, Double_t zRot, Int_t color, Int_t transparency, TString name)
Draw a rectangular prism.

References drawRectPrism().

◆ drawRectPrism() [2/2]

TEveGeoShape * eventdisplay::EveShapeDrawer::drawRectPrism ( Double_t  xPos,
Double_t  yPos,
Double_t  zPos,
Double_t  dX,
Double_t  dY,
Double_t  dZ,
Double_t  xRot,
Double_t  yRot,
Double_t  zRot,
Int_t  color,
Int_t  transparency,
TString  name 
)
inline

Draw a rectangular prism.

Parameters
xPosx coordinate for center of prism [mm]
yPosy coordinate for center of prism [mm]
zPosz coordinate for center of prism [mm]
dXwidth in x direction [mm]
dYwidth in y direction [mm]
dZwidth in z direction [mm]
xRotrotation around x-axis [degrees]
yRotrotation around y-axis [degrees]
zRotrotation around z-axis [degrees]
colorcolor of prism
transparencytransparency of prism
namename of prism

Definition at line 105 of file EveShapeDrawer.h.

108 {
109 TGeoCombiTrans* locAndOrien = new TGeoCombiTrans(
110 xPos, yPos, zPos, new TGeoRotation(name, xRot, yRot, zRot));
111
112 TEveGeoShape* rectPrism = new TEveGeoShape(name);
113 TGeoShape* box = new TGeoBBox(name, dX / 2, dY / 2, dZ / 2);
114 box->SetUniqueID(uid_++);
115 rectPrism->SetShape(box);
116 rectPrism->SetFillColor(color);
117 rectPrism->SetMainTransparency(transparency);
118 rectPrism->SetTransMatrix(*locAndOrien);
119
120 return rectPrism;
121 }

Referenced by eventdisplay::Objects::draw(), eventdisplay::Objects::draw(), eventdisplay::Objects::draw(), eventdisplay::EveDetectorGeometry::drawHCAL(), eventdisplay::EveDetectorGeometry::drawRecoilTracker(), and drawRectPrism().

◆ getInstance()

static EveShapeDrawer & eventdisplay::EveShapeDrawer::getInstance ( )
inlinestatic

Member Data Documentation

◆ uid_

UInt_t eventdisplay::EveShapeDrawer::uid_ = 0
private

Definition at line 151 of file EveShapeDrawer.h.


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