14 #include "TEveGeoNode.h"
15 #include "TEveStraightLineSet.h"
42 unsigned int iIndex, TEveElement& oItemHolder,
const FWViewContext* )
50 << rawid << std::endl;
54 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
56 segmentSet->SetLineWidth( 3 );
62 if( TGeoBBox* box = dynamic_cast<TGeoBBox*>( shape->GetShape()))
68 double localPosition[3] = { pos.
x(), pos.
y(), pos.
z() };
69 double localDirectionIn[3] = { dir.
x(), dir.
y(), dir.
z() };
70 double localDirectionOut[3] = { -dir.
x(), -dir.
y(), -dir.
z() };
72 Double_t distIn = box->DistFromInside( localPosition, localDirectionIn );
73 Double_t distOut = box->DistFromInside( localPosition, localDirectionOut );
76 float localSegmentInnerPoint[3] = {
static_cast<float>(localPosition[0] + vIn.
x()),
77 static_cast<float>(localPosition[1] + vIn.
y()),
78 static_cast<float>(localPosition[2] + vIn.
z())
81 float localSegmentOuterPoint[3] = {
static_cast<float>(localPosition[0] + vOut.
x()),
82 static_cast<float>(localPosition[1] + vOut.
y()),
83 static_cast<float>(localPosition[2] + vOut.
z())
86 float globalSegmentInnerPoint[3];
87 float globalSegmentOuterPoint[3];
89 geom->
localToGlobal( rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint );
91 segmentSet->AddLine( globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2],
92 globalSegmentOuterPoint[0], globalSegmentOuterPoint[1], globalSegmentOuterPoint[2] );
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
virtual ~FWDTSegmentProxyBuilder(void)
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
REGISTER_PROXYBUILDER_METHODS()
void localToGlobal(unsigned int id, const float *local, float *global) const
const FWEventItem * item() const
static const int kAll3DBits
uint32_t rawId() const
get the raw id
virtual LocalVector localDirection() const
Local direction in Chamber frame.
TEveGeoShape * getEveShape(unsigned int id) const
bool contains(unsigned int id) const
const FWDTSegmentProxyBuilder & operator=(const FWDTSegmentProxyBuilder &)
virtual LocalPoint localPosition() const
Local position in Chamber frame.
Vector3DBase unit() const
FWDTSegmentProxyBuilder(void)
const FWGeometry * getGeom() const