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);
133 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);
396 std::ostringstream
s;
398 std::string
name(
"cameraZoom");
402 std::string matrixName(
"cameraMatrix");
403 for (
unsigned int i = 0;
i < 16; ++
i ) {
404 std::ostringstream osIndex;
406 std::ostringstream osValue;
407 osValue << camera->GetCamTrans()[
i];
417 std::string zoomName(
"cameraZoom"); zoomName +=
typeName();
420 throw std::runtime_error(
"can't restore parameter cameraZoom");
426 std::string matrixName(
"cameraMatrix");
427 for (
unsigned int i = 0;
i < 16; ++
i ) {
428 std::ostringstream os;
433 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
435 std::istringstream
s(value->
value());
436 s>> (camera->RefCamTrans()[
i]);
439 catch (
const std::runtime_error& iException)
442 viewerGL()->ResetCamerasAfterNextUpdate();
445 camera->IncTimeStamp();
452 std::string matrixName(
"cameraMatrix");
453 for (
unsigned int i = 0;
i < 16; ++
i ){
454 std::ostringstream osIndex;
456 std::ostringstream osValue;
457 osValue << (cam->GetCamTrans())[i];
462 matrixName =
"cameraMatrixBase";
463 for (
unsigned int i = 0;
i < 16; ++
i ){
464 std::ostringstream osIndex;
466 std::ostringstream osValue;
467 osValue << (cam->GetCamBase())[i];
471 std::ostringstream osValue;
472 osValue << cam->fFOV;
481 std::string matrixName(
"cameraMatrix");
482 for (
unsigned int i = 0;
i < 16; ++
i ){
483 std::ostringstream os;
488 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
490 std::istringstream
s(value->
value());
491 s>>((cam->RefCamTrans())[i]);
495 matrixName =
"cameraMatrixBase";
496 for (
unsigned int i = 0;
i < 16; ++
i ){
497 std::ostringstream os;
502 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
505 std::istringstream
s(value->
value());
506 s>>((cam->RefCamBase())[i]);
513 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
515 std::istringstream
s(value->
value());
521 catch (
const std::runtime_error& iException)
524 viewerGL()->ResetCamerasAfterNextUpdate();
538 #
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
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=6)
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
void setPickCameraCenter(bool x)
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
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)
FWDoubleParameter m_lineOutlineScale
CmsShowCommon * commonPrefs() const
TGCompositeFrame * getTabContainer()
FWEnumParameter m_eventInfoLevel
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
perl if(1 lt scalar(@::datatypes))
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