17 #include <boost/bind.hpp>
23 #define private public
24 #include "TGLOrthoCamera.h"
25 #include "TGLPerspectiveCamera.h"
27 #include "TGLCameraGuide.h"
29 #include "TGLEmbeddedViewer.h"
30 #include "TEveViewer.h"
31 #include "TGLScenePad.h"
32 #include "TEveManager.h"
33 #include "TEveElement.h"
34 #include "TEveWindow.h"
35 #include "TEveScene.h"
36 #define protected public
39 #include "TGLOverlay.h"
67 TGLAnnotation(parent, text, posx, posy) {}
86 m_overlayEventInfo(0),
88 m_energyMaxValAnnotation(0),
92 #
if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
93 m_imageScale(this,
"Image Scale", 1.0, 1.0, 6.0),
95 m_eventInfoLevel(this,
"Overlay Event Info", 0
l, 0
l, 2
l),
96 m_drawCMSLogo(this,
"Show Logo",
false),
97 m_pointSmooth(this,
"Smooth points",
false),
98 m_pointSize(this,
"Point size", 1.0, 1.0, 10.0),
99 m_lineSmooth(this,
"Smooth lines",
false),
100 m_lineWidth(this,
"Line width",1.0,1.0,10.0),
101 m_lineOutlineScale(this,
"Outline width scale", 1.0, 0.01, 10.0),
102 m_lineWireframeScale(this,
"Wireframe width scale", 1.0, 0.01, 10.0),
103 m_showCameraGuide(this,
"Show Camera Guide",
false),
104 m_useGlobalEnergyScale(this,
"UseGlobalEnergyScale",
true),
107 m_viewEnergyScaleEditor(0)
111 TGLEmbeddedViewer* embeddedViewer;
112 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4)
113 embeddedViewer =
m_viewer->SpawnGLEmbeddedViewer(0);
115 embeddedViewer =
m_viewer->SpawnGLEmbeddedViewer();
118 gEve->GetViewers()->AddElement(
m_viewer);
128 m_geoScene->GetGLScene()->SetSelectable(kFALSE);
132 embeddedViewer->SetEventHandler(eh);
135 eh->SetDoInternalSelection(kFALSE);
207 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
210 succeeded =
viewerGL()->SavePicture(iName.c_str());
214 throw std::runtime_error(
"Unable to save picture");
317 calo->SetPlotEt(energyScale->
getPlotEt());
326 calo->SetMaxValAbs(100/f);
328 calo->ElementChanged();
370 (*it)->setFrom(iFrom);
391 ca = gEve->GetDefaultGLViewer()->RefLightColorSet().Selection(1).Arr();
392 viewerGL()->RefLightColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
393 ca = gEve->GetDefaultGLViewer()->RefLightColorSet().Selection(3).Arr();
394 viewerGL()->RefLightColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
395 ca = gEve->GetDefaultGLViewer()->RefDarkColorSet().Selection(1).Arr();
396 viewerGL()->RefDarkColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
397 ca = gEve->GetDefaultGLViewer()->RefDarkColorSet().Selection(3).Arr();
398 viewerGL()->RefDarkColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
408 std::ostringstream
s;
415 for (
unsigned int i = 0;
i < 16; ++
i ) {
416 std::ostringstream osIndex;
418 std::ostringstream osValue;
419 osValue << camera->GetCamTrans()[
i];
432 throw std::runtime_error(
"can't restore parameter cameraZoom");
439 for (
unsigned int i = 0;
i < 16; ++
i ) {
440 std::ostringstream os;
445 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
447 std::istringstream
s(value->
value());
448 s>> (camera->RefCamTrans()[
i]);
451 catch (
const std::runtime_error& iException)
454 viewerGL()->ResetCamerasAfterNextUpdate();
457 camera->IncTimeStamp();
465 for (
unsigned int i = 0;
i < 16; ++
i ){
466 std::ostringstream osIndex;
468 std::ostringstream osValue;
469 osValue << (cam->GetCamTrans())[i];
474 matrixName =
"cameraMatrixBase";
475 for (
unsigned int i = 0;
i < 16; ++
i ){
476 std::ostringstream osIndex;
478 std::ostringstream osValue;
479 osValue << (cam->GetCamBase())[i];
483 std::ostringstream osValue;
484 osValue << cam->fFOV;
494 for (
unsigned int i = 0;
i < 16; ++
i ){
495 std::ostringstream os;
500 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
502 std::istringstream
s(value->
value());
503 s>>((cam->RefCamTrans())[i]);
507 matrixName =
"cameraMatrixBase";
508 for (
unsigned int i = 0;
i < 16; ++
i ){
509 std::ostringstream os;
514 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
517 std::istringstream
s(value->
value());
518 s>>((cam->RefCamBase())[i]);
525 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
527 std::istringstream
s(value->
value());
533 catch (
const std::runtime_error& iException)
536 viewerGL()->ResetCamerasAfterNextUpdate();
550 #
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
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