#include <Fireworks/Core/interface/FWGlimpseView.h>
Public Member Functions | |
virtual void | addTo (FWConfiguration &) const |
FWGlimpseView (TEveWindowSlot *, FWViewType::EType) | |
virtual void | setFrom (const FWConfiguration &) |
virtual | ~FWGlimpseView () |
Private Member Functions | |
void | createAxis () |
FWGlimpseView (const FWGlimpseView &) | |
const FWGlimpseView & | operator= (const FWGlimpseView &) |
void | showAxes () |
void | showCylinder () |
Private Attributes | |
TEveGeoShape * | m_cylinder |
FWBoolParameter | m_showAxes |
FWBoolParameter | m_showCylinder |
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 36 of file FWGlimpseView.h.
FWGlimpseView::FWGlimpseView | ( | TEveWindowSlot * | iParent, |
FWViewType::EType | typeId | ||
) |
Definition at line 50 of file FWGlimpseView.cc.
References FWGenericParameter< T >::changed_, createAxis(), fireworks::getShape(), m_cylinder, m_showAxes, m_showCylinder, showAxes(), showCylinder(), FWViewBase::typeName(), FWEveView::viewer(), and FWEveView::viewerGL().
: FWEveView(iParent, typeId), m_cylinder(0), m_showAxes(this, "Show Axes", true ), m_showCylinder(this, "Show Cylinder", true) { createAxis(); // made new wireframe scene TEveScene* wns = gEve->SpawnNewScene(Form("Wireframe Scene %s", typeName().c_str())); viewer()->AddScene(wns); TGLScene* gls = wns->GetGLScene(); gls->SetStyle(TGLRnrCtx::kWireFrame); gls->SetLOD(TGLRnrCtx::kLODMed); gls->SetSelectable(kFALSE); TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur()); TGeoTube* tube = new TGeoTube(129,130,310); m_cylinder = fireworks::getShape("Detector outline", tube, kWhite); m_cylinder->SetPickable(kFALSE); m_cylinder->SetMainColor(kGray+3); wns->AddElement(m_cylinder); TGLViewer* ev = viewerGL(); ev->SetCurrentCamera(TGLViewer::kCameraPerspXOZ); m_showAxes.changed_.connect(boost::bind(&FWGlimpseView::showAxes,this)); m_showCylinder.changed_.connect(boost::bind(&FWGlimpseView::showCylinder,this)); }
FWGlimpseView::~FWGlimpseView | ( | ) | [virtual] |
Definition at line 79 of file FWGlimpseView.cc.
{ }
FWGlimpseView::FWGlimpseView | ( | const FWGlimpseView & | ) | [private] |
void FWGlimpseView::addTo | ( | FWConfiguration & | iTo | ) | const [virtual] |
Reimplemented from FWEveView.
Definition at line 169 of file FWGlimpseView.cc.
References FWEveView::addToPerspectiveCamera(), FWViewBase::typeName(), and FWEveView::viewerGL().
{ FWEveView::addTo(iTo); TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera())); if (camera) addToPerspectiveCamera(camera, typeName(), iTo); }
void FWGlimpseView::createAxis | ( | ) | [private] |
Definition at line 89 of file FWGlimpseView.cc.
References FWEveView::geoScene().
Referenced by FWGlimpseView().
{ // create 3D axes TEveElementList* axisHolder = new TEveElementList("GlimpseAxisHolder"); TGLFont::EMode fontMode = TGLFont::kPixmap; Int_t fs = 14; Color_t fcol = kGray+1; // X axis TEveStraightLineSet* xAxis = new TEveStraightLineSet( "GlimpseXAxis" ); xAxis->SetPickable(kTRUE); xAxis->SetTitle("Energy Scale, 100 GeV, X-axis (LHC center)"); xAxis->SetLineStyle(3); xAxis->SetLineColor(fcol); xAxis->AddLine(-100,0,0,100,0,0); axisHolder->AddElement(xAxis); TEveText* xTxt = new TEveText( "X+" ); xTxt->PtrMainTrans()->SetPos(100-fs, -fs, 0); xTxt->SetFontMode(fontMode); xTxt->SetMainColor(fcol); axisHolder->AddElement(xTxt); // Y axis TEveStraightLineSet* yAxis = new TEveStraightLineSet( "GlimpseYAxis" ); yAxis->SetPickable(kTRUE); yAxis->SetTitle("Energy Scale, 100 GeV, Y-axis (upward)"); yAxis->SetLineColor(fcol); yAxis->SetLineStyle(3); yAxis->AddLine(0,-100,0,0,100,0); axisHolder->AddElement(yAxis); TEveText* yTxt = new TEveText( "Y+" ); yTxt->PtrMainTrans()->SetPos(0, 100-fs, 0); yTxt->SetFontMode(fontMode); yTxt->SetMainColor(fcol); axisHolder->AddElement(yTxt); // Z axis TEveStraightLineSet* zAxis = new TEveStraightLineSet( "GlimpseZAxis" ); zAxis->SetPickable(kTRUE); zAxis->SetTitle("Energy Scale, 100 GeV, Z-axis (west, along beam)"); zAxis->SetLineColor(fcol); zAxis->AddLine(0,0,-100,0,0,100); axisHolder->AddElement(zAxis); TEveText* zTxt = new TEveText( "Z+" ); zTxt->PtrMainTrans()->SetPos(0, -fs, 100 - zTxt->GetExtrude()*2); zTxt->SetFontMode(fontMode); zTxt->SetMainColor(fcol); axisHolder->AddElement(zTxt); geoScene()->AddElement(axisHolder); }
const FWGlimpseView& FWGlimpseView::operator= | ( | const FWGlimpseView & | ) | [private] |
void FWGlimpseView::setFrom | ( | const FWConfiguration & | iFrom | ) | [virtual] |
Reimplemented from FWEveView.
Definition at line 178 of file FWGlimpseView.cc.
References FWEveView::setFromPerspectiveCamera(), FWViewBase::typeName(), and FWEveView::viewerGL().
{ FWEveView::setFrom(iFrom); TGLPerspectiveCamera* camera = dynamic_cast<TGLPerspectiveCamera*>(&(viewerGL()->CurrentCamera())); if (camera) setFromPerspectiveCamera(camera, typeName(), iFrom); }
void FWGlimpseView::showAxes | ( | ) | [private] |
Definition at line 147 of file FWGlimpseView.cc.
References m_showAxes, FWGenericParameter< T >::value(), and FWEveView::viewerGL().
Referenced by FWGlimpseView().
{ if ( m_showAxes.value() ) viewerGL()->SetGuideState(TGLUtil::kAxesOrigin, kTRUE, kFALSE, 0); else viewerGL()->SetGuideState(TGLUtil::kAxesNone, kTRUE, kFALSE, 0); }
void FWGlimpseView::showCylinder | ( | ) | [private] |
Definition at line 157 of file FWGlimpseView.cc.
References m_cylinder, m_showCylinder, and FWGenericParameter< T >::value().
Referenced by FWGlimpseView().
{ if ( m_showCylinder.value() ) m_cylinder->SetRnrState(kTRUE); else m_cylinder->SetRnrState(kFALSE); gEve->Redraw3D(); }
TEveGeoShape* FWGlimpseView::m_cylinder [private] |
Definition at line 58 of file FWGlimpseView.h.
Referenced by FWGlimpseView(), and showCylinder().
FWBoolParameter FWGlimpseView::m_showAxes [private] |
Definition at line 61 of file FWGlimpseView.h.
Referenced by FWGlimpseView(), and showAxes().
FWBoolParameter FWGlimpseView::m_showCylinder [private] |
Definition at line 62 of file FWGlimpseView.h.
Referenced by FWGlimpseView(), and showCylinder().