1 #include "TEveGeoNode.h"
2 #include "TEveStraightLineSet.h"
29 TEveElement& oItemHolder,
38 TEveElement& oItemHolder,
48 << rawid << std::endl;
52 TEveStraightLineSet* segmentSet =
new TEveStraightLineSet();
54 segmentSet->SetLineWidth( 3 );
55 segmentSet->SetMarkerColor(
item()->defaultDisplayProperties().
color());
56 segmentSet->SetMarkerSize(0.5);
61 if( TGeoTrap* box = dynamic_cast<TGeoTrap*>( shape->GetShape()))
63 shape->SetMainTransparency( 75 );
64 shape->SetMainColor(
item()->defaultDisplayProperties().
color());
65 segmentSet->AddElement( shape );
71 double localPosition[3] = { pos.
x(), pos.
y(), pos.
z() };
72 double localDirectionIn[3] = { dir.
x(), dir.
y(), dir.
z() };
73 double localDirectionOut[3] = { -dir.
x(), -dir.
y(), -dir.
z() };
75 Double_t distIn = box->DistFromInside( localPosition, localDirectionIn );
76 Double_t distOut = box->DistFromInside( localPosition, localDirectionOut );
79 float localSegmentInnerPoint[3] = {
static_cast<float>(localPosition[0] + vIn.
x()),
80 static_cast<float>(localPosition[1] + vIn.
y()),
81 static_cast<float>(localPosition[2] + vIn.
z())
84 float localSegmentOuterPoint[3] = {
static_cast<float>(localPosition[0] + vOut.
x()),
85 static_cast<float>(localPosition[1] + vOut.
y()),
86 static_cast<float>(localPosition[2] + vOut.
z())
89 float globalSegmentInnerPoint[3];
90 float globalSegmentOuterPoint[3];
92 geom->
localToGlobal( rawid, localSegmentInnerPoint, globalSegmentInnerPoint, localSegmentOuterPoint, globalSegmentOuterPoint );
94 segmentSet->AddMarker( globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2] );
97 segmentSet->AddLine( globalSegmentInnerPoint[0], globalSegmentInnerPoint[1], globalSegmentInnerPoint[2],
98 globalSegmentOuterPoint[0], globalSegmentOuterPoint[1], globalSegmentOuterPoint[2] );
#define REGISTER_PROXYBUILDER_METHODS()
const FWGEMSegmentProxyBuilder & operator=(const FWGEMSegmentProxyBuilder &)
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
virtual bool haveSingleProduct() const
static const int kAllRPZBits
GEMDetId gemDetId() const
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
const FWEventItem * item() const
static const int kAll3DBits
uint32_t rawId() const
get the raw id
FWGEMSegmentProxyBuilder()
TEveGeoShape * getEveShape(unsigned int id) const
LocalPoint localPosition() const
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Abs< T >::type abs(const T &t)
bool contains(unsigned int id) const
virtual ~FWGEMSegmentProxyBuilder()
Vector3DBase unit() const
virtual void buildViewType(const GEMSegment &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *)
LocalVector localDirection() const
Local direction.
const FWGeometry * getGeom() const