4 #include "TEveViewer.h"
6 #include "TGLAnnotation.h"
8 #include "TEveVector.h"
26 const char*
p =
id.item()->purpose().c_str();
27 bool enabled = (strstr(p,
"Beam Spot") || strstr(p,
"Vertices"));
41 gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), v->GetGLWidget()->GetId(), iX, iY,
x,
y, wdummy);
43 TGLVector3 pnt(x, y, 0.5 * v->GetSelRec().GetMinZ());
44 v->CurrentCamera().WindowToViewport(pnt);
45 pnt = v->CurrentCamera().ViewportToWorld(pnt);
47 switch (iEntryIndex) {
49 TGFrame*
f = v->GetGLWidget();
50 gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), f->GetId(), iX, iY,
x,
y, wdummy);
53 if (
id.
item()->haveInterestingValue())
54 name +=
", " +
id.item()->modelInterestingValueAsString(
id.
index());
57 new TGLAnnotation(v, name.c_str(), x * 1.f / f->GetWidth(), 1 - y * 1.f / f->GetHeight(), pnt);
58 an->SetUseColorSet(
true);
59 an->SetTextSize(0.03);
74 v->CurrentCamera().SetExternalCenter(
true);
75 v->CurrentCamera().SetCenterVec(pnt.X(), pnt.Y(), pnt.Z());
76 v->SetDrawCameraCenter(
true);
86 v->CurrentCamera().SetExternalCenter(
false);
87 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
void select(int iEntryIndex, const FWModelId &id, int iX, int iY) override
TGLViewer * viewerGL() const
static bool isProjected(int)
FWViewContextMenuHandlerGL(FWEveView *v)
void init(FWViewContextMenuHandlerBase::MenuEntryAdder &, const FWModelId &id) override
Called when have to add entries to the context menu.
FWSelectionManager * selectionManager() const
void shiftOrigin(TEveVector ¢er)
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