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);
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);
395 std::ostringstream
s;
397 std::string
name(
"cameraZoom");
401 std::string matrixName(
"cameraMatrix");
402 for (
unsigned int i = 0;
i < 16; ++
i ) {
403 std::ostringstream osIndex;
405 std::ostringstream osValue;
406 osValue << camera->GetCamTrans()[
i];
416 std::string zoomName(
"cameraZoom"); zoomName +=
typeName();
419 throw std::runtime_error(
"can't restore parameter cameraZoom");
425 std::string matrixName(
"cameraMatrix");
426 for (
unsigned int i = 0;
i < 16; ++
i ) {
427 std::ostringstream os;
432 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
434 std::istringstream
s(value->
value());
435 s>> (camera->RefCamTrans()[
i]);
438 catch (
const std::runtime_error& iException)
441 viewerGL()->ResetCamerasAfterNextUpdate();
444 camera->IncTimeStamp();
451 std::string matrixName(
"cameraMatrix");
452 for (
unsigned int i = 0;
i < 16; ++
i ){
453 std::ostringstream osIndex;
455 std::ostringstream osValue;
456 osValue << (cam->GetCamTrans())[i];
461 matrixName =
"cameraMatrixBase";
462 for (
unsigned int i = 0;
i < 16; ++
i ){
463 std::ostringstream osIndex;
465 std::ostringstream osValue;
466 osValue << (cam->GetCamBase())[i];
470 std::ostringstream osValue;
471 osValue << cam->fFOV;
480 std::string matrixName(
"cameraMatrix");
481 for (
unsigned int i = 0;
i < 16; ++
i ){
482 std::ostringstream os;
487 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
489 std::istringstream
s(value->
value());
490 s>>((cam->RefCamTrans())[i]);
494 matrixName =
"cameraMatrixBase";
495 for (
unsigned int i = 0;
i < 16; ++
i ){
496 std::ostringstream os;
501 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
504 std::istringstream
s(value->
value());
505 s>>((cam->RefCamBase())[i]);
512 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
514 std::istringstream
s(value->
value());
520 catch (
const std::runtime_error& iException)
523 viewerGL()->ResetCamerasAfterNextUpdate();
537 #
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
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)
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