CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
FWViewContextMenuHandlerGL Class Reference

#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 FWViewContextMenuHandlerGLoperator= (const FWViewContextMenuHandlerGL &)
 

Private Attributes

bool m_pickCameraCenter
 
TEveViewer * m_viewer
 

Detailed Description

Definition at line 9 of file FWViewContextMenuHandlerGL.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

FWViewContextMenuHandlerGL::FWViewContextMenuHandlerGL ( TEveViewer *  v)

Definition at line 11 of file FWViewContextMenuHandlerGL.cc.

11  :
12 m_viewer(v),
13 m_pickCameraCenter(false)
14 {
15 }
mathSSE::Vec4< T > v
virtual FWViewContextMenuHandlerGL::~FWViewContextMenuHandlerGL ( )
inlinevirtual

Definition at line 15 of file FWViewContextMenuHandlerGL.h.

15 {}
FWViewContextMenuHandlerGL::FWViewContextMenuHandlerGL ( const FWViewContextMenuHandlerGL )
private

Member Function Documentation

void FWViewContextMenuHandlerGL::init ( FWViewContextMenuHandlerBase::MenuEntryAdder adder)
privatevirtual

Definition at line 18 of file FWViewContextMenuHandlerGL.cc.

References FWViewContextMenuHandlerBase::MenuEntryAdder::addEntry(), and m_pickCameraCenter.

19 {
20  adder.addEntry("Add Annotation");
22  {
23  adder.addEntry("Set Camera Center");
24  adder.addEntry("Reset Camera Center");
25  }
26 }
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.

Referenced by python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), python.Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), python.Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), python.Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), and python.Vispa.Views.AbstractView.AbstractView::restoreSelection().

30 {
31  TGLViewer* v = m_viewer->GetGLViewer();
32 
33  Window_t wdummy;
34  Int_t x,y;
35  gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), v->GetGLWidget()->GetId(), iX, iY, x, y, wdummy);
36  TGLVector3 pnt(x, y, 0.5*v->GetSelRec().GetMinZ());
37  v->CurrentCamera().WindowToViewport(pnt);
38  pnt = v->CurrentCamera().ViewportToWorld(pnt);
39 
40  switch (iEntryIndex)
41  {
42  case kAnnotate:
43  {
44  TGFrame* f = v->GetGLWidget();
45  gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), f->GetId(), iX, iY, x, y, wdummy);
46 
47  std::string name = id.item()->modelName(id.index());
48  if (id.item()->haveInterestingValue())
49  name += ", " + id.item()->modelInterestingValueAsString(id.index());
50 
51  TGLAnnotation* an = new TGLAnnotation(v, name.c_str(), x*1.f/f->GetWidth(), 1 - y*1.f/f->GetHeight(), pnt);
52  an->SetUseColorSet(true);
53  an->SetTextSize(0.03);
54  break;
55  }
56  case kCameraCenter:
57  {
58  v->CurrentCamera().SetExternalCenter(true);
59  v->SetDrawCameraCenter(true);
60  v->CurrentCamera().SetCenterVec(pnt.X(), pnt.Y(), pnt.Z());
61  break;
62  }
63  case kResetCameraCenter:
64  {
65  v->CurrentCamera().SetExternalCenter(false);
66  v->SetDrawCameraCenter(false);
67  break;
68  }
69  }
70 }
double f[11][100]
mathSSE::Vec4< T > v
void FWViewContextMenuHandlerGL::setPickCameraCenter ( bool  x)
inline

Member Data Documentation

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().