16 #include <boost/bind.hpp> 22 #include "TGLOrthoCamera.h" 23 #include "TGLPerspectiveCamera.h" 24 #include "TGLCameraGuide.h" 26 #include "TGLEmbeddedViewer.h" 27 #include "TGLScenePad.h" 28 #include "TEveManager.h" 29 #include "TEveElement.h" 30 #include "TEveWindow.h" 31 #include "TEveScene.h" 33 #include "TGLOverlay.h" 64 TGLAnnotation(parent, text, posx, posy) {}
86 m_energyMaxValAnnotation(
nullptr),
89 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
90 m_imageScale(this,
"Image Scale", 1.0, 1.0, 6.0),
92 m_eventInfoLevel(this,
"Overlay Event Info", 0
l, 0
l, 2
l),
93 m_drawCMSLogo(this,
"Show Logo",
false),
94 m_pointSmooth(this,
"Smooth points",
false),
95 m_pointSize(this,
"Point size", 1.0, 1.0, 10.0),
96 m_lineSmooth(this,
"Smooth lines",
false),
97 m_lineWidth(this,
"Line width",1.0,1.0,10.0),
98 m_lineOutlineScale(this,
"Outline width scale", 1.0, 0.01, 10.0),
99 m_lineWireframeScale(this,
"Wireframe width scale", 1.0, 0.01, 10.0),
100 m_showCameraGuide(this,
"Show Camera Guide",
false),
101 m_useGlobalEnergyScale(this,
"UseGlobalEnergyScale",
true),
104 m_viewEnergyScaleEditor(
nullptr)
110 gEve->GetViewers()->AddElement(
m_viewer);
120 m_geoScene->GetGLScene()->SetSelectable(kFALSE);
124 embeddedViewer->SetEventHandler(eh);
127 eh->SetDoInternalSelection(kFALSE);
211 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0) 214 succeeded =
viewerGL()->SavePicture(iName.c_str());
218 throw std::runtime_error(
"Unable to save picture");
321 calo->SetPlotEt(energyScale->
getPlotEt());
330 calo->SetMaxValAbs(100/f);
332 calo->ElementChanged();
383 (*it)->setFrom(iFrom);
406 const UChar_t* ca =
nullptr;
408 ca = lcs.Selection(1).CArr();
409 viewerGL()->RefLightColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
410 ca = lcs.Selection(3).CArr();
411 viewerGL()->RefLightColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
412 ca = dcs.Selection(1).CArr();
413 viewerGL()->RefDarkColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
414 ca = dcs.Selection(3).CArr();
415 viewerGL()->RefDarkColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
432 for (
unsigned int i = 0;
i < 16; ++
i ) {
433 std::ostringstream osIndex;
435 std::ostringstream osValue;
436 osValue << camera->GetCamTrans()[
i];
449 throw std::runtime_error(
"can't restore parameter cameraZoom");
455 for (
unsigned int i = 0;
i < 16; ++
i ) {
456 std::ostringstream os;
459 if ( value ==
nullptr )
461 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
463 std::istringstream
s(value->
value());
464 s>> (camera->RefCamTrans()[
i]);
467 catch (
const std::runtime_error& iException)
470 viewerGL()->ResetCamerasAfterNextUpdate();
473 camera->IncTimeStamp();
481 for (
unsigned int i = 0;
i < 16; ++
i ){
482 std::ostringstream osIndex;
484 std::ostringstream osValue;
485 osValue << (cam->GetCamTrans())[i];
490 matrixName =
"cameraMatrixBase";
491 for (
unsigned int i = 0;
i < 16; ++
i ){
492 std::ostringstream osIndex;
494 std::ostringstream osValue;
495 osValue << (cam->GetCamBase())[i];
508 for (
unsigned int i = 0;
i < 16; ++
i ){
509 std::ostringstream os;
512 if ( value ==
nullptr )
514 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
516 std::istringstream
s(value->
value());
517 s>>((cam->RefCamTrans())[i]);
521 matrixName =
"cameraMatrixBase";
522 for (
unsigned int i = 0;
i < 16; ++
i ){
523 std::ostringstream os;
526 if ( value ==
nullptr )
528 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
531 std::istringstream
s(value->
value());
532 s>>((cam->RefCamBase())[i]);
537 if ( value ==
nullptr )
539 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
541 cam->SetFOV(std::stod(value->
value()));
546 catch (
const std::runtime_error& iException)
549 viewerGL()->ResetCamerasAfterNextUpdate();
563 #
if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
float getScaleFactor3D() const
void addTo(FWConfiguration &) const override
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
FWEventAnnotation * m_overlayEventInfo
FWViewContextMenuHandlerBase * contextMenuHandler() const override
std::vector< FWParameterBase * >::const_iterator const_iterator
virtual TEveCaloViz * getEveCalo() const
virtual void useGlobalEnergyScaleChanged()
const_iterator begin() const
std::shared_ptr< FWViewContextMenuHandlerGL > m_viewContextMenu
FWTGLViewer * fwViewerGL() const
virtual void pointLineScalesChanged()
void voteMaxEtAndEnergy(float Et, float energy) const
ScaleAnnotation(TGLViewerBase *parent, const char *text, Float_t posx, Float_t posy)
ViewerParameterGUI & requestTab(const char *)
FWViewEnergyScale * getEnergyScale() const
const std::string & typeName() const
virtual void setFrom(const FWConfiguration &)
unsigned int version() const
virtual void setupEventCenter()
FWViewEnergyScaleEditor * m_viewEnergyScaleEditor
virtual void setupEnergyScale()
void addFrameToContainer(TGCompositeFrame *)
FWDoubleParameter m_pointSize
TGLViewer * viewerGL() const
void updateScaleFactors(float iMaxVal)
sigc::signal< void, T > changed_
const fireworks::Context * m_context
TEveElement * m_ownedProducts
FWBoolParameter m_lineSmooth
unsigned int version() const
FWBoolParameter m_showCameraGuide
FWBoolParameter m_useGlobalEnergyScale
~ScaleAnnotation() override
virtual void cameraGuideChanged()
virtual void voteCaloMaxVal()
virtual void setFrom(const FWConfiguration &)
ScaleAnnotation * m_energyMaxValAnnotation
FWTGLViewer * fwGlViewer()
void setText(const char *txt)
float getScaleFactorLego() const
const_iterator end() const
bool addEntry(Long_t id, const std::string &txt)
const TGLColorSet & getLightColorSet() const
float getMaxEnergyInEvent(bool isEt) const
virtual void resetCamera()
virtual void addTo(FWConfiguration &) const
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
void saveImageTo(const std::string &iName) const override
FWBoolParameter m_drawCMSLogo
void setViewer(FWEveView *ev)
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
std::unique_ptr< FWViewEnergyScale > m_localEnergyScale
virtual void eventBegin()
const std::string & value(unsigned int iIndex=0) const
const fireworks::Context & context()
FWBoolParameter m_pointSmooth
FWDoubleParameter m_imageScale
void setFrom(const FWConfiguration &) override
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
FWViewContext * viewContext()
FWViewEnergyScale * getEnergyScale() const
virtual void setBackgroundColor(Color_t)
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
FWDoubleParameter m_lineOutlineScale
const TGLColorSet & getDarkColorSet() const
CmsShowCommon * commonPrefs() const
TGCompositeFrame * getTabContainer()
void addTo(FWConfiguration &) const override
FWEnumParameter m_eventInfoLevel
std::unique_ptr< FWViewContext > m_viewContext
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
virtual void addTo(FWConfiguration &) const
const FWConfiguration * valueForKey(const std::string &iKey) const
virtual bool isEnergyScaleGlobal() const
FWDoubleParameter m_lineWidth
FWDoubleParameter m_lineWireframeScale
void setFromOrthoCamera(TGLOrthoCamera *, const FWConfiguration &)
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
TGLCameraGuide * m_cameraGuide
virtual void setContext(const fireworks::Context &x)
FWTGLViewer * SpawnFWTGLViewer()
void populateController(ViewerParameterGUI &) const override
CmsAnnotation * m_overlayLogo
FWViewType::EType typeId() const
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const