20 #include "TGLOrthoCamera.h" 21 #include "TGLPerspectiveCamera.h" 22 #include "TGLCameraGuide.h" 24 #include "TGLEmbeddedViewer.h" 25 #include "TGLScenePad.h" 26 #include "TEveManager.h" 27 #include "TEveElement.h" 28 #include "TEveWindow.h" 29 #include "TEveScene.h" 31 #include "TGLOverlay.h" 63 void setText(
const char* txt) { fText = txt; }
74 m_eventScene(nullptr),
75 m_ownedProducts(nullptr),
77 m_overlayEventInfo(nullptr),
78 m_overlayLogo(nullptr),
79 m_energyMaxValAnnotation(nullptr),
80 m_cameraGuide(nullptr),
82 #
if ROOT_VERSION_CODE >= ROOT_VERSION(5, 26, 0)
83 m_imageScale(this,
"Image Scale", 1.0, 1.0, 6.0),
85 m_eventInfoLevel(this,
"Overlay Event Info", 0
l, 0
l, 2
l),
86 m_drawCMSLogo(this,
"Show Logo",
false),
87 m_pointSmooth(this,
"Smooth points",
false),
88 m_pointSize(this,
"Point size", 1.0, 1.0, 10.0),
89 m_lineSmooth(this,
"Smooth lines",
false),
90 m_lineWidth(this,
"Line width", 1.0, 1.0, 10.0),
91 m_lineOutlineScale(this,
"Outline width scale", 1.0, 0.01, 10.0),
92 m_lineWireframeScale(this,
"Wireframe width scale", 1.0, 0.01, 10.0),
93 m_showCameraGuide(this,
"Show Camera Guide",
false),
94 m_useGlobalEnergyScale(this,
"UseGlobalEnergyScale",
true),
97 m_viewEnergyScaleEditor(nullptr) {
102 gEve->GetViewers()->AddElement(
m_viewer);
112 m_geoScene->GetGLScene()->SetSelectable(kFALSE);
116 embeddedViewer->SetEventHandler(eh);
119 eh->SetDoInternalSelection(kFALSE);
185 #if ROOT_VERSION_CODE >= ROOT_VERSION(5, 26, 0) 192 throw std::runtime_error(
"Unable to save picture");
273 calo->SetMaxValAbs(100 /
f);
275 calo->ElementChanged();
317 (*it)->setFrom(iFrom);
337 const UChar_t* ca =
nullptr;
339 ca = lcs.Selection(1).CArr();
340 viewerGL()->RefLightColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
341 ca = lcs.Selection(3).CArr();
342 viewerGL()->RefLightColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
343 ca = dcs.Selection(1).CArr();
344 viewerGL()->RefDarkColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
345 ca = dcs.Selection(3).CArr();
346 viewerGL()->RefDarkColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
359 for (
unsigned int i = 0;
i < 16; ++
i) {
360 std::ostringstream osIndex;
362 std::ostringstream osValue;
363 osValue << camera->GetCamTrans()[
i];
374 throw std::runtime_error(
"can't restore parameter cameraZoom");
380 for (
unsigned int i = 0;
i < 16; ++
i) {
381 std::ostringstream
os;
384 if (
value ==
nullptr) {
385 throw std::runtime_error(
"can't restore parameter cameraMatrix.");
387 std::istringstream
s(
value->value());
388 s >> (camera->RefCamTrans()[
i]);
390 }
catch (
const std::runtime_error& iException) {
392 viewerGL()->ResetCamerasAfterNextUpdate();
394 camera->IncTimeStamp();
400 for (
unsigned int i = 0;
i < 16; ++
i) {
401 std::ostringstream osIndex;
403 std::ostringstream osValue;
404 osValue << (cam->GetCamTrans())[
i];
409 matrixName =
"cameraMatrixBase";
410 for (
unsigned int i = 0;
i < 16; ++
i) {
411 std::ostringstream osIndex;
413 std::ostringstream osValue;
414 osValue << (cam->GetCamBase())[
i];
425 for (
unsigned int i = 0;
i < 16; ++
i) {
426 std::ostringstream
os;
429 if (
value ==
nullptr) {
430 throw std::runtime_error(
"can't restore parameter cameraMatrix.");
432 std::istringstream
s(
value->value());
433 s >> ((cam->RefCamTrans())[
i]);
437 matrixName =
"cameraMatrixBase";
438 for (
unsigned int i = 0;
i < 16; ++
i) {
439 std::ostringstream
os;
442 if (
value ==
nullptr) {
443 throw std::runtime_error(
"can't restore parameter cameraMatrixBase.");
446 std::istringstream
s(
value->value());
447 s >> ((cam->RefCamBase())[
i]);
452 if (
value ==
nullptr) {
453 throw std::runtime_error(
"can't restore parameter cameraMatrixBase.");
455 cam->SetFOV(std::stod(
value->value()));
459 }
catch (
const std::runtime_error& iException) {
461 viewerGL()->ResetCamerasAfterNextUpdate();
473 #
if ROOT_VERSION_CODE >= ROOT_VERSION(5, 26, 0)
FWEventAnnotation * m_overlayEventInfo
CmsShowCommon * commonPrefs() const
virtual void useGlobalEnergyScaleChanged()
virtual void addTo(FWConfiguration &) const
const_iterator begin() const
std::shared_ptr< FWViewContextMenuHandlerGL > m_viewContextMenu
virtual void pointLineScalesChanged()
ScaleAnnotation(TGLViewerBase *parent, const char *text, Float_t posx, Float_t posy)
ViewerParameterGUI & requestTab(const char *)
float getMaxEnergyInEvent(bool isEt) const
FWTGLViewer * fwViewerGL() const
ViewerParameterGUI & separator()
virtual void setFrom(const FWConfiguration &)
virtual void setupEventCenter()
FWViewEnergyScaleEditor * m_viewEnergyScaleEditor
virtual void setupEnergyScale()
void addFrameToContainer(TGCompositeFrame *)
FWDoubleParameter m_pointSize
void updateScaleFactors(float iMaxVal)
std::vector< FWParameterBase * >::const_iterator const_iterator
const TGLColorSet & getDarkColorSet() const
const fireworks::Context * m_context
virtual void addTo(FWConfiguration &) const
TEveElement * m_ownedProducts
FWBoolParameter m_lineSmooth
virtual bool isEnergyScaleGlobal() const
sigc::signal< void(Int_t, Int_t)> openSelectedModelContextMenu_
static std::string to_string(const XMLCh *ch)
const_iterator end() const
float getScaleFactorLego() const
FWBoolParameter m_showCameraGuide
FWViewEnergyScale * getEnergyScale() const
FWBoolParameter m_useGlobalEnergyScale
~ScaleAnnotation() override
virtual void cameraGuideChanged()
virtual void voteCaloMaxVal()
const std::string & value(unsigned int iIndex=0) const
virtual void setFrom(const FWConfiguration &)
ScaleAnnotation * m_energyMaxValAnnotation
FWTGLViewer * fwGlViewer()
void setText(const char *txt)
virtual TEveCaloViz * getEveCalo() const
void voteMaxEtAndEnergy(float Et, float energy) const
void saveImageTo(const std::string &iName) const override
bool addEntry(Long_t id, const std::string &txt)
FWViewContextMenuHandlerBase * contextMenuHandler() const override
virtual void resetCamera()
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
FWBoolParameter m_drawCMSLogo
void setViewer(FWEveView *ev)
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
std::unique_ptr< FWViewEnergyScale > m_localEnergyScale
virtual void eventBegin()
FWViewEnergyScale * getEnergyScale() const
const TGLColorSet & getLightColorSet() const
const fireworks::Context & context()
FWBoolParameter m_pointSmooth
float getScaleFactor3D() const
FWDoubleParameter m_imageScale
void populateController(ViewerParameterGUI &) const override
void setFrom(const FWConfiguration &) override
sigc::signal< void(Int_t, Int_t)> openSelectedModelContextMenu_
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
FWViewContext * viewContext()
virtual void setBackgroundColor(Color_t)
unsigned int version() const
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
FWDoubleParameter m_lineOutlineScale
ViewerParameterGUI & addParam(const FWParameterBase *)
TGCompositeFrame * getTabContainer()
const FWConfiguration * valueForKey(const std::string &iKey) const
FWEnumParameter m_eventInfoLevel
std::unique_ptr< FWViewContext > m_viewContext
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
sigc::signal< void(T)> changed_
FWViewType::EType typeId() const
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
FWDoubleParameter m_lineWidth
void addTo(FWConfiguration &) const override
FWDoubleParameter m_lineWireframeScale
TGLViewer * viewerGL() const
void addTo(FWConfiguration &) const override
void setFromOrthoCamera(TGLOrthoCamera *, const FWConfiguration &)
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
TGLCameraGuide * m_cameraGuide
virtual void setContext(const fireworks::Context &x)
FWTGLViewer * SpawnFWTGLViewer()
const std::string & typeName() const
unsigned int version() const
CmsAnnotation * m_overlayLogo