7#ifndef EVENTDISPLAY_EVESHAPEDRAWER_H_
8#define EVENTDISPLAY_EVESHAPEDRAWER_H_
15#include "TEveGeoShape.h"
16#include "TGeoMatrix.h"
21namespace eventdisplay {
34 return EVE_SHAPE_DRAWER;
52 TEveGeoShape*
drawHexPrism(Double_t xPos, Double_t yPos, Double_t zPos,
53 Double_t xRot, Double_t yRot, Double_t zRot,
54 Double_t h, Double_t r, Int_t color,
55 Int_t transparency, TString name) {
56 TGeoCombiTrans* locAndOrien =
new TGeoCombiTrans(
57 xPos, yPos, zPos,
new TGeoRotation(name, xRot, yRot, zRot));
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);
83 Double_t zRot, Int_t color, Int_t transparency,
85 return drawHexPrism(prism.x, prism.y, prism.z, xRot, yRot, zRot,
86 prism.height, prism.radius, color, transparency, name);
106 Double_t dX, Double_t dY, Double_t dZ,
107 Double_t xRot, Double_t yRot, Double_t zRot,
108 Int_t color, Int_t transparency, TString name) {
109 TGeoCombiTrans* locAndOrien =
new TGeoCombiTrans(
110 xPos, yPos, zPos,
new TGeoRotation(name, xRot, yRot, zRot));
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);
135 Double_t yRot, Double_t zRot, Int_t color,
136 Int_t transparency, TString name) {
137 std::vector<double> center(3, 0);
138 std::vector<double> widths(3, 0);
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);
145 return drawRectPrism(center[0], center[1], center[2], widths[0], widths[1],
146 widths[2], xRot, yRot, zRot, color, transparency,
Header file for class DetectorGeometry.
std::vector< std::pair< double, double > > BoundingBox
@type BoundingBox
Helper class for drawing common shapes.
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 * 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 * 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.
static EveShapeDrawer & getInstance()
Get Instance of Drawer.
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.
Stores the necessary geometry details for a hexagonal prism.