16 #include <boost/bind.hpp>
22 #define private public
23 #include "TGLOrthoCamera.h"
24 #include "TGLPerspectiveCamera.h"
26 #include "TGLCameraGuide.h"
28 #include "TGLEmbeddedViewer.h"
29 #include "TEveViewer.h"
30 #include "TGLScenePad.h"
31 #include "TEveManager.h"
32 #include "TEveElement.h"
33 #include "TEveWindow.h"
34 #include "TEveScene.h"
35 #define protected public
38 #include "TGLOverlay.h"
66 TGLAnnotation(parent, text, posx, posy) {}
86 m_overlayEventInfo(0),
88 m_energyMaxValAnnotation(0),
91 #
if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
92 m_imageScale(this,
"Image Scale", 1.0, 1.0, 6.0),
94 m_eventInfoLevel(this,
"Overlay Event Info", 0
l, 0
l, 2
l),
95 m_drawCMSLogo(this,
"Show Logo",
false),
96 m_pointSmooth(this,
"Smooth points",
false),
97 m_pointSize(this,
"Point size", 1.0, 1.0, 10.0),
98 m_lineSmooth(this,
"Smooth lines",
false),
99 m_lineWidth(this,
"Line width",1.0,1.0,10.0),
100 m_lineOutlineScale(this,
"Outline width scale", 1.0, 0.01, 10.0),
101 m_lineWireframeScale(this,
"Wireframe width scale", 1.0, 0.01, 10.0),
102 m_showCameraGuide(this,
"Show Camera Guide",
false),
103 m_useGlobalEnergyScale(this,
"UseGlobalEnergyScale",
true),
106 m_viewEnergyScaleEditor(0)
110 TGLEmbeddedViewer* embeddedViewer;
111 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4)
112 embeddedViewer =
m_viewer->SpawnGLEmbeddedViewer(0);
114 embeddedViewer =
m_viewer->SpawnGLEmbeddedViewer();
117 gEve->GetViewers()->AddElement(
m_viewer);
127 m_geoScene->GetGLScene()->SetSelectable(kFALSE);
131 embeddedViewer->SetEventHandler(eh);
134 eh->SetDoInternalSelection(kFALSE);
206 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
209 succeeded =
viewerGL()->SavePicture(iName.c_str());
213 throw std::runtime_error(
"Unable to save picture");
316 calo->SetPlotEt(energyScale->
getPlotEt());
325 calo->SetMaxValAbs(100/f);
327 calo->ElementChanged();
369 (*it)->setFrom(iFrom);
390 ca = gEve->GetDefaultGLViewer()->RefLightColorSet().Selection(1).Arr();
391 viewerGL()->RefLightColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
392 ca = gEve->GetDefaultGLViewer()->RefLightColorSet().Selection(3).Arr();
393 viewerGL()->RefLightColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
394 ca = gEve->GetDefaultGLViewer()->RefDarkColorSet().Selection(1).Arr();
395 viewerGL()->RefDarkColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
396 ca = gEve->GetDefaultGLViewer()->RefDarkColorSet().Selection(3).Arr();
397 viewerGL()->RefDarkColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
407 std::ostringstream
s;
414 for (
unsigned int i = 0;
i < 16; ++
i ) {
415 std::ostringstream osIndex;
417 std::ostringstream osValue;
418 osValue << camera->GetCamTrans()[
i];
431 throw std::runtime_error(
"can't restore parameter cameraZoom");
438 for (
unsigned int i = 0;
i < 16; ++
i ) {
439 std::ostringstream os;
444 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
446 std::istringstream
s(value->
value());
447 s>> (camera->RefCamTrans()[
i]);
450 catch (
const std::runtime_error& iException)
453 viewerGL()->ResetCamerasAfterNextUpdate();
456 camera->IncTimeStamp();
464 for (
unsigned int i = 0;
i < 16; ++
i ){
465 std::ostringstream osIndex;
467 std::ostringstream osValue;
468 osValue << (cam->GetCamTrans())[i];
473 matrixName =
"cameraMatrixBase";
474 for (
unsigned int i = 0;
i < 16; ++
i ){
475 std::ostringstream osIndex;
477 std::ostringstream osValue;
478 osValue << (cam->GetCamBase())[i];
482 std::ostringstream osValue;
483 osValue << cam->fFOV;
493 for (
unsigned int i = 0;
i < 16; ++
i ){
494 std::ostringstream os;
499 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
501 std::istringstream
s(value->
value());
502 s>>((cam->RefCamTrans())[i]);
506 matrixName =
"cameraMatrixBase";
507 for (
unsigned int i = 0;
i < 16; ++
i ){
508 std::ostringstream os;
513 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
516 std::istringstream
s(value->
value());
517 s>>((cam->RefCamBase())[i]);
524 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
526 std::istringstream
s(value->
value());
532 catch (
const std::runtime_error& iException)
535 viewerGL()->ResetCamerasAfterNextUpdate();
549 #
if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
float getScaleFactor3D() const
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
FWEventAnnotation * m_overlayEventInfo
std::vector< FWParameterBase * >::const_iterator const_iterator
virtual TEveCaloViz * getEveCalo() const
virtual void useGlobalEnergyScaleChanged()
const_iterator begin() const
std::auto_ptr< FWViewContext > m_viewContext
virtual void populateController(ViewerParameterGUI &) 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
virtual void setFrom(const FWConfiguration &)
const std::string & typeName() const
virtual void setFrom(const FWConfiguration &)
unsigned int version() const
FWViewEnergyScaleEditor * m_viewEnergyScaleEditor
virtual void setupEnergyScale()
void addFrameToContainer(TGCompositeFrame *)
FWDoubleParameter m_pointSize
virtual FWViewContextMenuHandlerBase * contextMenuHandler() const
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
virtual void cameraGuideChanged()
virtual void voteCaloMaxVal()
virtual void setFrom(const FWConfiguration &)
virtual void saveImageTo(const std::string &iName) const
ScaleAnnotation * m_energyMaxValAnnotation
void setText(const char *txt)
float getScaleFactorLego() const
const_iterator end() const
bool addEntry(Long_t id, const std::string &txt)
float getMaxEnergyInEvent(bool isEt) const
virtual void resetCamera()
virtual void addTo(FWConfiguration &) const
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
FWBoolParameter m_drawCMSLogo
void setViewer(FWEveView *ev)
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
virtual void eventBegin()
std::auto_ptr< FWViewEnergyScale > m_localEnergyScale
const std::string & value(unsigned int iIndex=0) const
const fireworks::Context & context()
FWBoolParameter m_pointSmooth
FWDoubleParameter m_imageScale
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
FWViewContext * viewContext()
FWViewEnergyScale * getEnergyScale() const
virtual ~ScaleAnnotation()
virtual void setBackgroundColor(Color_t)
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
FWDoubleParameter m_lineOutlineScale
CmsShowCommon * commonPrefs() const
TGCompositeFrame * getTabContainer()
FWEnumParameter m_eventInfoLevel
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
boost::shared_ptr< FWViewContextMenuHandlerGL > m_viewContextMenu
virtual void addTo(FWConfiguration &) const
const FWConfiguration * valueForKey(const std::string &iKey) const
volatile std::atomic< bool > shutdown_flag false
virtual bool isEnergyScaleGlobal() const
FWDoubleParameter m_lineWidth
FWDoubleParameter m_lineWireframeScale
void setFromOrthoCamera(TGLOrthoCamera *, const FWConfiguration &)
virtual void addTo(FWConfiguration &) const
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
TGLCameraGuide * m_cameraGuide
virtual void setContext(const fireworks::Context &x)
CmsAnnotation * m_overlayLogo
virtual void addTo(FWConfiguration &) const
FWViewType::EType typeId() const
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const