#include <FWViewContextMenuHandlerGL.h>
Public Types | |
enum | GLViewerAction { kAnnotate, kCameraCenter, kResetCameraCenter, kNone } |
Public Member Functions | |
FWViewContextMenuHandlerGL (TEveViewer *v) | |
virtual void | select (int iEntryIndex, const FWModelId &id, int iX, int iY) |
void | setPickCameraCenter (bool x) |
virtual | ~FWViewContextMenuHandlerGL () |
Private Member Functions | |
FWViewContextMenuHandlerGL (const FWViewContextMenuHandlerGL &) | |
virtual void | init (FWViewContextMenuHandlerBase::MenuEntryAdder &) |
const FWViewContextMenuHandlerGL & | operator= (const FWViewContextMenuHandlerGL &) |
Private Attributes | |
bool | m_pickCameraCenter |
TEveViewer * | m_viewer |
Definition at line 9 of file FWViewContextMenuHandlerGL.h.
Definition at line 12 of file FWViewContextMenuHandlerGL.h.
FWViewContextMenuHandlerGL::FWViewContextMenuHandlerGL | ( | TEveViewer * | v | ) |
Definition at line 11 of file FWViewContextMenuHandlerGL.cc.
: m_viewer(v), m_pickCameraCenter(false) { }
virtual FWViewContextMenuHandlerGL::~FWViewContextMenuHandlerGL | ( | ) | [inline, virtual] |
Definition at line 15 of file FWViewContextMenuHandlerGL.h.
{}
FWViewContextMenuHandlerGL::FWViewContextMenuHandlerGL | ( | const FWViewContextMenuHandlerGL & | ) | [private] |
void FWViewContextMenuHandlerGL::init | ( | FWViewContextMenuHandlerBase::MenuEntryAdder & | adder | ) | [private, virtual] |
Definition at line 18 of file FWViewContextMenuHandlerGL.cc.
References FWViewContextMenuHandlerBase::MenuEntryAdder::addEntry(), and m_pickCameraCenter.
{ adder.addEntry("Add Annotation"); if (m_pickCameraCenter) { adder.addEntry("Set Camera Center"); adder.addEntry("Reset Camera Center"); } }
const FWViewContextMenuHandlerGL& FWViewContextMenuHandlerGL::operator= | ( | const FWViewContextMenuHandlerGL & | ) | [private] |
void FWViewContextMenuHandlerGL::select | ( | int | iEntryIndex, |
const FWModelId & | id, | ||
int | iX, | ||
int | iY | ||
) | [virtual] |
Definition at line 29 of file FWViewContextMenuHandlerGL.cc.
References f, getHLTprescales::index, kAnnotate, kCameraCenter, kResetCameraCenter, m_viewer, AlCaRecoCosmics_cfg::name, v, ExpressReco_HICollisions_FallBack::x, and ExpressReco_HICollisions_FallBack::y.
{ TGLViewer* v = m_viewer->GetGLViewer(); Window_t wdummy; Int_t x,y; gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), v->GetGLWidget()->GetId(), iX, iY, x, y, wdummy); TGLVector3 pnt(x, y, 0.5*v->GetSelRec().GetMinZ()); v->CurrentCamera().WindowToViewport(pnt); pnt = v->CurrentCamera().ViewportToWorld(pnt); switch (iEntryIndex) { case kAnnotate: { TGFrame* f = v->GetGLWidget(); gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), f->GetId(), iX, iY, x, y, wdummy); std::string name = id.item()->modelName(id.index()); if (id.item()->haveInterestingValue()) name += ", " + id.item()->modelInterestingValueAsString(id.index()); TGLAnnotation* an = new TGLAnnotation(v, name.c_str(), x*1.f/f->GetWidth(), 1 - y*1.f/f->GetHeight(), pnt); an->SetUseColorSet(true); an->SetTextSize(0.03); break; } case kCameraCenter: { v->CurrentCamera().SetExternalCenter(true); v->SetDrawCameraCenter(true); v->CurrentCamera().SetCenterVec(pnt.X(), pnt.Y(), pnt.Z()); break; } case kResetCameraCenter: { v->CurrentCamera().SetExternalCenter(false); v->SetDrawCameraCenter(false); break; } } }
void FWViewContextMenuHandlerGL::setPickCameraCenter | ( | bool | x | ) | [inline] |
Definition at line 18 of file FWViewContextMenuHandlerGL.h.
References m_pickCameraCenter, and ExpressReco_HICollisions_FallBack::x.
Referenced by FWEveView::FWEveView().
{ m_pickCameraCenter = x; }
bool FWViewContextMenuHandlerGL::m_pickCameraCenter [private] |
Definition at line 27 of file FWViewContextMenuHandlerGL.h.
Referenced by init(), and setPickCameraCenter().
TEveViewer* FWViewContextMenuHandlerGL::m_viewer [private] |
Definition at line 26 of file FWViewContextMenuHandlerGL.h.
Referenced by select().