|
|
Go to the documentation of this file.
14 #include <boost/bind.hpp>
20 #include "TGLOrthoCamera.h"
21 #include "TGLPerspectiveCamera.h"
22 #include "TGLCameraGuide.h"
24 #include "TGLEmbeddedViewer.h"
25 #include "TGLScenePad.h"
26 #include "TEveManager.h"
27 #include "TEveElement.h"
28 #include "TEveWindow.h"
29 #include "TEveScene.h"
31 #include "TGLOverlay.h"
63 void setText(
const char* txt) { fText = txt; }
74 m_eventScene(nullptr),
75 m_ownedProducts(nullptr),
77 m_overlayEventInfo(nullptr),
78 m_overlayLogo(nullptr),
79 m_energyMaxValAnnotation(nullptr),
80 m_cameraGuide(nullptr),
82 #if ROOT_VERSION_CODE >= ROOT_VERSION(5, 26, 0)
83 m_imageScale(this,
"Image Scale", 1.0, 1.0, 6.0),
85 m_eventInfoLevel(this,
"Overlay Event Info", 0
l, 0
l, 2
l),
86 m_drawCMSLogo(this,
"Show Logo",
false),
87 m_pointSmooth(this,
"Smooth points",
false),
88 m_pointSize(this,
"Point size", 1.0, 1.0, 10.0),
89 m_lineSmooth(this,
"Smooth lines",
false),
90 m_lineWidth(this,
"Line width", 1.0, 1.0, 10.0),
91 m_lineOutlineScale(this,
"Outline width scale", 1.0, 0.01, 10.0),
92 m_lineWireframeScale(this,
"Wireframe width scale", 1.0, 0.01, 10.0),
93 m_showCameraGuide(this,
"Show Camera Guide",
false),
94 m_useGlobalEnergyScale(this,
"UseGlobalEnergyScale",
true),
97 m_viewEnergyScaleEditor(nullptr) {
102 gEve->GetViewers()->AddElement(
m_viewer);
112 m_geoScene->GetGLScene()->SetSelectable(kFALSE);
116 embeddedViewer->SetEventHandler(eh);
119 eh->SetDoInternalSelection(kFALSE);
185 #if ROOT_VERSION_CODE >= ROOT_VERSION(5, 26, 0)
192 throw std::runtime_error(
"Unable to save picture");
273 calo->SetMaxValAbs(100 /
f);
275 calo->ElementChanged();
317 (*it)->setFrom(iFrom);
337 const UChar_t* ca =
nullptr;
339 ca = lcs.Selection(1).CArr();
340 viewerGL()->RefLightColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
341 ca = lcs.Selection(3).CArr();
342 viewerGL()->RefLightColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
343 ca = dcs.Selection(1).CArr();
344 viewerGL()->RefDarkColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
345 ca = dcs.Selection(3).CArr();
346 viewerGL()->RefDarkColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
359 for (
unsigned int i = 0;
i < 16; ++
i) {
360 std::ostringstream osIndex;
362 std::ostringstream osValue;
363 osValue << camera->GetCamTrans()[
i];
374 throw std::runtime_error(
"can't restore parameter cameraZoom");
380 for (
unsigned int i = 0;
i < 16; ++
i) {
381 std::ostringstream os;
384 if (
value ==
nullptr) {
385 throw std::runtime_error(
"can't restore parameter cameraMatrix.");
387 std::istringstream
s(
value->value());
388 s >> (camera->RefCamTrans()[
i]);
390 }
catch (
const std::runtime_error& iException) {
392 viewerGL()->ResetCamerasAfterNextUpdate();
394 camera->IncTimeStamp();
400 for (
unsigned int i = 0;
i < 16; ++
i) {
401 std::ostringstream osIndex;
403 std::ostringstream osValue;
404 osValue << (cam->GetCamTrans())[
i];
409 matrixName =
"cameraMatrixBase";
410 for (
unsigned int i = 0;
i < 16; ++
i) {
411 std::ostringstream osIndex;
413 std::ostringstream osValue;
414 osValue << (cam->GetCamBase())[
i];
425 for (
unsigned int i = 0;
i < 16; ++
i) {
426 std::ostringstream os;
429 if (
value ==
nullptr) {
430 throw std::runtime_error(
"can't restore parameter cameraMatrix.");
432 std::istringstream
s(
value->value());
433 s >> ((cam->RefCamTrans())[
i]);
437 matrixName =
"cameraMatrixBase";
438 for (
unsigned int i = 0;
i < 16; ++
i) {
439 std::ostringstream os;
442 if (
value ==
nullptr) {
443 throw std::runtime_error(
"can't restore parameter cameraMatrixBase.");
446 std::istringstream
s(
value->value());
447 s >> ((cam->RefCamBase())[
i]);
452 if (
value ==
nullptr) {
453 throw std::runtime_error(
"can't restore parameter cameraMatrixBase.");
455 cam->SetFOV(std::stod(
value->value()));
459 }
catch (
const std::runtime_error& iException) {
461 viewerGL()->ResetCamerasAfterNextUpdate();
473 #
if ROOT_VERSION_CODE >= ROOT_VERSION(5, 26, 0)
virtual void setupEnergyScale()
const TGLColorSet & getLightColorSet() const
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
std::vector< FWParameterBase * >::const_iterator const_iterator
FWViewContextMenuHandlerBase * contextMenuHandler() const override
void addFrameToContainer(TGCompositeFrame *)
FWDoubleParameter m_lineWireframeScale
FWBoolParameter m_useGlobalEnergyScale
FWBoolParameter m_drawCMSLogo
std::unique_ptr< FWViewEnergyScale > m_localEnergyScale
virtual TEveCaloViz * getEveCalo() const
virtual void eventBegin()
const std::string & typeName() const
FWViewEnergyScaleEditor * m_viewEnergyScaleEditor
void setViewer(FWEveView *ev)
void setText(const char *txt)
void populateController(ViewerParameterGUI &) const override
void setFrom(const FWConfiguration &) override
bool addEntry(Long_t id, const std::string &txt)
FWViewContext * viewContext()
const_iterator end() const
void updateScaleFactors(float iMaxVal)
FWBoolParameter m_lineSmooth
const TGLColorSet & getDarkColorSet() const
virtual void addTo(FWConfiguration &) const
const_iterator begin() const
virtual void useGlobalEnergyScaleChanged()
TGLCameraGuide * m_cameraGuide
virtual void setupEventCenter()
void saveImageTo(const std::string &iName) const override
FWViewType::EType typeId() const
sigc::signal< void, T > changed_
FWViewEnergyScale * getEnergyScale() const
ViewerParameterGUI & separator()
const fireworks::Context & context()
void setFromPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)
void voteMaxEtAndEnergy(float Et, float energy) const
std::shared_ptr< FWViewContextMenuHandlerGL > m_viewContextMenu
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
virtual void pointLineScalesChanged()
const FWConfiguration * valueForKey(const std::string &iKey) const
virtual void cameraGuideChanged()
CmsShowCommon * commonPrefs() const
FWBoolParameter m_pointSmooth
CmsAnnotation * m_overlayLogo
virtual bool isEnergyScaleGlobal() const
void addToOrthoCamera(TGLOrthoCamera *, FWConfiguration &) const
float getScaleFactorLego() const
const std::string & value(unsigned int iIndex=0) const
FWBoolParameter m_showCameraGuide
FWDoubleParameter m_pointSize
TGCompositeFrame * getTabContainer()
virtual void setBackgroundColor(Color_t)
virtual void setFrom(const FWConfiguration &)
const fireworks::Context * m_context
FWEventAnnotation * m_overlayEventInfo
TEveElement * m_ownedProducts
virtual void addTo(FWConfiguration &) const
FWTGLViewer * fwGlViewer()
std::unique_ptr< FWViewContext > m_viewContext
FWEveView(TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
float getMaxEnergyInEvent(bool isEt) const
unsigned int version() const
ScaleAnnotation(TGLViewerBase *parent, const char *text, Float_t posx, Float_t posy)
float getScaleFactor3D() const
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
FWEnumParameter m_eventInfoLevel
FWTGLViewer * SpawnFWTGLViewer()
void addToPerspectiveCamera(TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
void setFromOrthoCamera(TGLOrthoCamera *, const FWConfiguration &)
void addTo(FWConfiguration &) const override
void addTo(FWConfiguration &) const override
unsigned int version() const
static Bool_t setColorSetViewer(TGLViewer *, Color_t)
ScaleAnnotation * m_energyMaxValAnnotation
virtual void resetCamera()
FWDoubleParameter m_imageScale
TGLViewer * viewerGL() const
virtual void setFrom(const FWConfiguration &)
~ScaleAnnotation() override
virtual void setContext(const fireworks::Context &x)
virtual void voteCaloMaxVal()
FWDoubleParameter m_lineOutlineScale
FWViewEnergyScale * getEnergyScale() const
FWTGLViewer * fwViewerGL() const
ViewerParameterGUI & addParam(const FWParameterBase *)
FWDoubleParameter m_lineWidth
ViewerParameterGUI & requestTab(const char *)