4 #include "TEveViewer.h" 6 #include "TGLAnnotation.h" 8 #include "TEveVector.h" 25 const char*
p =
id.item()->purpose().c_str();
26 bool enabled = (strstr(p,
"Beam Spot") || strstr(p,
"Vertices"));
40 gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), v->GetGLWidget()->GetId(), iX, iY,
x,
y, wdummy);
42 TGLVector3 pnt(x, y, 0.5 * v->GetSelRec().GetMinZ());
43 v->CurrentCamera().WindowToViewport(pnt);
44 pnt = v->CurrentCamera().ViewportToWorld(pnt);
46 switch (iEntryIndex) {
48 TGFrame*
f = v->GetGLWidget();
49 gVirtualX->TranslateCoordinates(gClient->GetDefaultRoot()->GetId(), f->GetId(), iX, iY,
x,
y, wdummy);
52 if (
id.
item()->haveInterestingValue())
53 name +=
", " +
id.item()->modelInterestingValueAsString(
id.
index());
56 new TGLAnnotation(v, name.c_str(), x * 1.f / f->GetWidth(), 1 - y * 1.f / f->GetHeight(), pnt);
57 an->SetUseColorSet(
true);
58 an->SetTextSize(0.03);
73 v->CurrentCamera().SetExternalCenter(
true);
74 v->CurrentCamera().SetCenterVec(pnt.X(), pnt.Y(), pnt.Z());
75 v->SetDrawCameraCenter(
true);
85 v->CurrentCamera().SetExternalCenter(
false);
86 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