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);
395 ca = lcs.Selection(1).CArr();
396 viewerGL()->RefLightColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
397 ca = lcs.Selection(3).CArr();
398 viewerGL()->RefLightColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
399 ca = dcs.Selection(1).CArr();
400 viewerGL()->RefDarkColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
401 ca = dcs.Selection(3).CArr();
402 viewerGL()->RefDarkColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
413 std::ostringstream
s;
415 std::string
name(
"cameraZoom");
419 std::string matrixName(
"cameraMatrix");
420 for (
unsigned int i = 0;
i < 16; ++
i ) {
421 std::ostringstream osIndex;
423 std::ostringstream osValue;
424 osValue << camera->GetCamTrans()[
i];
434 std::string zoomName(
"cameraZoom"); zoomName +=
typeName();
437 throw std::runtime_error(
"can't restore parameter cameraZoom");
443 std::string matrixName(
"cameraMatrix");
444 for (
unsigned int i = 0;
i < 16; ++
i ) {
445 std::ostringstream os;
450 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
452 std::istringstream
s(value->
value());
453 s>> (camera->RefCamTrans()[
i]);
456 catch (
const std::runtime_error& iException)
459 viewerGL()->ResetCamerasAfterNextUpdate();
462 camera->IncTimeStamp();
469 std::string matrixName(
"cameraMatrix");
470 for (
unsigned int i = 0;
i < 16; ++
i ){
471 std::ostringstream osIndex;
473 std::ostringstream osValue;
474 osValue << (cam->GetCamTrans())[i];
479 matrixName =
"cameraMatrixBase";
480 for (
unsigned int i = 0;
i < 16; ++
i ){
481 std::ostringstream osIndex;
483 std::ostringstream osValue;
484 osValue << (cam->GetCamBase())[i];
488 std::ostringstream osValue;
489 osValue << cam->fFOV;
498 std::string matrixName(
"cameraMatrix");
499 for (
unsigned int i = 0;
i < 16; ++
i ){
500 std::ostringstream os;
505 throw std::runtime_error (
"can't restore parameter cameraMatrix.");
507 std::istringstream
s(value->
value());
508 s>>((cam->RefCamTrans())[i]);
512 matrixName =
"cameraMatrixBase";
513 for (
unsigned int i = 0;
i < 16; ++
i ){
514 std::ostringstream os;
519 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
522 std::istringstream
s(value->
value());
523 s>>((cam->RefCamBase())[i]);
530 throw std::runtime_error (
"can't restore parameter cameraMatrixBase.");
532 std::istringstream
s(value->
value());
538 catch (
const std::runtime_error& iException)
541 viewerGL()->ResetCamerasAfterNextUpdate();
555 #
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
void setViewer(TEveViewer *ev)
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)
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_
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
const TGLColorSet & getDarkColorSet() const
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