4 #include "TEveViewer.h" 6 #include "TGLAnnotation.h" 8 #include "TEveVector.h" 31 const char*
p =
id.item()->purpose().c_str();
32 bool enabled = (strstr(p,
"Beam Spot") || strstr(p,
"Vertices") );
50 gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), v->GetGLWidget()->GetId(), iX, iY,
x,
y, wdummy);
52 TGLVector3 pnt(x, y, 0.5*v->GetSelRec().GetMinZ());
53 v->CurrentCamera().WindowToViewport(pnt);
54 pnt = v->CurrentCamera().ViewportToWorld(pnt);
60 TGFrame*
f = v->GetGLWidget();
61 gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), f->GetId(), iX, iY,
x,
y, wdummy);
64 if (
id.item()->haveInterestingValue())
65 name +=
", " +
id.item()->modelInterestingValueAsString(
id.
index());
67 TGLAnnotation *an =
new TGLAnnotation(v, name.c_str(), x*1.f/f->GetWidth(), 1 - y*1.f/f->GetHeight(), pnt);
68 an->SetUseColorSet(
true);
69 an->SetTextSize(0.03);
88 v->CurrentCamera().SetExternalCenter(
true);
89 v->CurrentCamera().SetCenterVec(pnt.X(), pnt.Y(), pnt.Z());
90 v->SetDrawCameraCenter(
true);
102 v->CurrentCamera().SetExternalCenter(
false);
103 v->SetDrawCameraCenter(
false);
const std::set< FWModelId > & selected() const
const FWItemValueGetter & valueGetter() const
one value from the model which is normally used for the popup
virtual void select(int iEntryIndex, const FWModelId &id, int iX, int iY)
TGLViewer * viewerGL() const
static bool isProjected(int)
FWViewContextMenuHandlerGL(FWEveView *v)
FWSelectionManager * selectionManager() const
void shiftOrigin(TEveVector ¢er)
virtual void init(FWViewContextMenuHandlerBase::MenuEntryAdder &, const FWModelId &id)
Called when have to add entries to the context menu.
const fireworks::Context & context()
double valueFor(const void *, int idx) const
int addEntry(const char *iEntryName, int idx, bool enable=true)
const void * modelData(int iIndex) const
const FWEventItem * item() const
FWViewType::EType typeId() const