CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

FWEveView Class Reference

#include <FWEveView.h>

Inheritance diagram for FWEveView:
FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable FW3DViewBase FWGlimpseView FWLegoViewBase FWRPZView FW3DView FWISpyView FWEveLegoView FWHFView

List of all members.

Public Member Functions

virtual void addTo (FWConfiguration &) const
const fireworks::Contextcontext ()
virtual
FWViewContextMenuHandlerBase
contextMenuHandler () const
virtual void eventBegin ()
virtual void eventEnd ()
TEveScene * eventScene ()
 FWEveView (TEveWindowSlot *, FWViewType::EType, unsigned int version=7)
TEveScene * geoScene ()
virtual bool isEnergyScaleGlobal () const
TEveElement * ownedProducts ()
virtual void populateController (ViewerParameterGUI &) const
virtual void saveImageTo (const std::string &iName) const
virtual void setBackgroundColor (Color_t)
virtual void setContext (const fireworks::Context &x)
virtual void setFrom (const FWConfiguration &)
virtual void setupEnergyScale ()
virtual void useGlobalEnergyScaleChanged ()
FWViewContextviewContext ()
TEveViewer * viewer ()
TGLViewer * viewerGL () const
virtual void voteCaloMaxVal ()
virtual ~FWEveView ()

Protected Member Functions

void addToOrthoCamera (TGLOrthoCamera *, FWConfiguration &) const
void addToPerspectiveCamera (TGLPerspectiveCamera *, const std::string &, FWConfiguration &) const
virtual void cameraGuideChanged ()
virtual TEveCaloViz * getEveCalo () const
virtual void pointLineScalesChanged ()
virtual void resetCamera ()
void setFromOrthoCamera (TGLOrthoCamera *, const FWConfiguration &)
void setFromPerspectiveCamera (TGLPerspectiveCamera *, const std::string &, const FWConfiguration &)

Private Member Functions

 FWEveView (const FWEveView &)
const FWEveViewoperator= (const FWEveView &)

Private Attributes

TGLCameraGuide * m_cameraGuide
const fireworks::Contextm_context
FWBoolParameter m_drawCMSLogo
ScaleAnnotationm_energyMaxValAnnotation
FWEnumParameter m_eventInfoLevel
TEveScene * m_eventScene
TEveScene * m_geoScene
FWDoubleParameter m_imageScale
FWDoubleParameter m_lineOutlineScale
FWBoolParameter m_lineSmooth
FWDoubleParameter m_lineWidth
FWDoubleParameter m_lineWireframeScale
std::auto_ptr< FWViewEnergyScalem_localEnergyScale
FWEventAnnotationm_overlayEventInfo
CmsAnnotationm_overlayLogo
TEveElement * m_ownedProducts
FWDoubleParameter m_pointSize
FWBoolParameter m_pointSmooth
FWBoolParameter m_showCameraGuide
FWBoolParameter m_useGlobalEnergyScale
std::auto_ptr< FWViewContextm_viewContext
boost::shared_ptr
< FWViewContextMenuHandlerGL
m_viewContextMenu
FWViewEnergyScaleEditorm_viewEnergyScaleEditor
TEveViewer * m_viewer

Detailed Description

Definition at line 53 of file FWEveView.h.


Constructor & Destructor Documentation

FWEveView::FWEveView ( TEveWindowSlot *  iParent,
FWViewType::EType  type,
unsigned int  version = 7 
)

Definition at line 80 of file FWEveView.cc.

References FWEnumParameter::addEntry(), cameraGuideChanged(), FWGenericParameter< T >::changed_, m_cameraGuide, m_drawCMSLogo, m_energyMaxValAnnotation, m_eventInfoLevel, m_eventScene, m_geoScene, m_lineOutlineScale, m_lineSmooth, m_lineWidth, m_lineWireframeScale, m_localEnergyScale, m_overlayEventInfo, m_overlayLogo, m_ownedProducts, m_pointSize, m_pointSmooth, m_showCameraGuide, m_useGlobalEnergyScale, m_viewContext, m_viewContextMenu, m_viewer, FWGLEventHandler::openSelectedModelContextMenu_, FWViewBase::openSelectedModelContextMenu_, pointLineScalesChanged(), FWEventAnnotation::setLevel(), setupEnergyScale(), FWGLEventHandler::setViewer(), CmsAnnotation::setVisible(), FWViewBase::typeName(), useGlobalEnergyScaleChanged(), and viewerGL().

                                                                                        :
   FWViewBase(type, version),
   m_viewer(0),
   m_eventScene(0),
   m_ownedProducts(0),
   m_geoScene(0),
   m_overlayEventInfo(0),
   m_overlayLogo(0),
   m_energyMaxValAnnotation(0),
   m_cameraGuide(0),
   m_context(0),
   // style
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
   m_imageScale(this, "Image Scale", 1.0, 1.0, 6.0),
#endif
   m_eventInfoLevel(this, "Overlay Event Info", 0l, 0l, 2l),
   m_drawCMSLogo(this,"Show Logo",false),
   m_pointSmooth(this, "Smooth points", false),
   m_pointSize(this, "Point size", 1.0, 1.0, 10.0),
   m_lineSmooth(this, "Smooth lines", false),
   m_lineWidth(this,"Line width",1.0,1.0,10.0),
   m_lineOutlineScale(this, "Outline width scale", 1.0, 0.01, 10.0),
   m_lineWireframeScale(this, "Wireframe width scale", 1.0, 0.01, 10.0),
   m_showCameraGuide(this,"Show Camera Guide",false),
   m_useGlobalEnergyScale(this, "UseGlobalEnergyScale", true),
   m_viewContext( new FWViewContext()),
   m_localEnergyScale( new FWViewEnergyScale(FWViewType::idToName(type), version)),
   m_viewEnergyScaleEditor(0)
{
   m_viewer = new TEveViewer(typeName().c_str());

   TGLEmbeddedViewer* embeddedViewer;
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,25,4)
   embeddedViewer =  m_viewer->SpawnGLEmbeddedViewer(0);
#else
   embeddedViewer =  m_viewer->SpawnGLEmbeddedViewer();
#endif
   iParent->ReplaceWindow(m_viewer);
   gEve->GetViewers()->AddElement(m_viewer);

   m_eventScene =  gEve->SpawnNewScene(Form("EventScene %s", typeName().c_str()));
   m_ownedProducts = new TEveElementList("ViewSpecificProducts");
   m_eventScene->AddElement(m_ownedProducts);

   m_viewer->AddScene(m_eventScene);

   // spawn geo scene
   m_geoScene = gEve->SpawnNewScene(Form("GeoScene %s", typeName().c_str()));
   m_geoScene->GetGLScene()->SetSelectable(kFALSE);
   m_viewer->AddScene(m_geoScene);

   FWGLEventHandler* eh = new FWGLEventHandler((TGWindow*)embeddedViewer->GetGLWidget(), (TObject*)embeddedViewer);
   embeddedViewer->SetEventHandler(eh);
   eh->setViewer(m_viewer);
   eh->openSelectedModelContextMenu_.connect(openSelectedModelContextMenu_);
   eh->SetDoInternalSelection(kFALSE);
   FWViewContextMenuHandlerGL* ctxHand = new FWViewContextMenuHandlerGL(this);
   // ctxHand->setPickCameraCenter(true);
   m_viewContextMenu.reset(ctxHand);
   
   m_energyMaxValAnnotation = new ScaleAnnotation(viewerGL(), "empty", 0.1, 0.9);
   m_energyMaxValAnnotation->SetRole(TGLOverlayElement::kViewer);
   m_energyMaxValAnnotation->SetState(TGLOverlayElement::kInvisible);
   m_energyMaxValAnnotation->SetUseColorSet(false);
   m_energyMaxValAnnotation->SetTextSize(0.05);
   m_energyMaxValAnnotation->SetTextColor(kMagenta);

   // style params

   m_overlayEventInfo = new FWEventAnnotation(embeddedViewer);
   m_overlayEventInfo->setLevel(0);

   m_eventInfoLevel.addEntry(0, "Nothing");
   m_eventInfoLevel.addEntry(1, "Run / event");
   m_eventInfoLevel.addEntry(2, "Run / event / lumi");
   m_eventInfoLevel.addEntry(3, "Full");
   m_eventInfoLevel.changed_.connect(boost::bind(&FWEventAnnotation::setLevel,m_overlayEventInfo, _1));
   
   m_overlayLogo = new CmsAnnotation(embeddedViewer, 0.02, 0.98);
   m_overlayLogo->setVisible(false);
   m_drawCMSLogo.changed_.connect(boost::bind(&CmsAnnotation::setVisible,m_overlayLogo, _1));

   m_cameraGuide = new TGLCameraGuide(0.9, 0.1, 0.08);
   m_cameraGuide->SetState(TGLOverlayElement::kInvisible);
   embeddedViewer->AddOverlayElement(m_cameraGuide);
   m_showCameraGuide.changed_.connect(boost::bind(&FWEveView::cameraGuideChanged,this));

   m_pointSmooth.changed_.connect(boost::bind(&FWEveView::pointLineScalesChanged,this));
   m_pointSize.changed_.connect(boost::bind(&FWEveView::pointLineScalesChanged,this));
   m_lineSmooth.changed_.connect(boost::bind(&FWEveView::pointLineScalesChanged,this));
   m_lineWidth.changed_.connect(boost::bind(&FWEveView::pointLineScalesChanged,this));
   m_lineOutlineScale.changed_.connect(boost::bind(&FWEveView::pointLineScalesChanged,this));
   m_lineWireframeScale.changed_.connect(boost::bind(&FWEveView::pointLineScalesChanged,this));


   // create scale for view  .. 
   m_viewContext->setEnergyScale(m_localEnergyScale.get());
   m_useGlobalEnergyScale.changed_.connect(boost::bind(&FWEveView::useGlobalEnergyScaleChanged, this));
   m_localEnergyScale->parameterChanged_.connect(boost::bind(&FWEveView::setupEnergyScale, this));
}
FWEveView::~FWEveView ( ) [virtual]

Definition at line 181 of file FWEveView.cc.

References m_eventScene, m_geoScene, and m_viewer.

{
   m_geoScene->RemoveElements();
   m_eventScene->RemoveElements();
   m_viewer->DestroyWindowAndSlot();
}
FWEveView::FWEveView ( const FWEveView ) [private]

Member Function Documentation

void FWEveView::addTo ( FWConfiguration iTo) const [virtual]

Reimplemented from FWConfigurableParameterizable.

Reimplemented in FW3DViewBase, FWGlimpseView, FWLegoViewBase, and FWRPZView.

Definition at line 338 of file FWEveView.cc.

References CmsAnnotation::addTo(), FWEventAnnotation::addTo(), m_overlayEventInfo, m_overlayLogo, and m_viewContext.

{
   // take care of parameters
   FWConfigurableParameterizable::addTo(iTo);
   
   { 
      assert ( m_overlayEventInfo );
      m_overlayEventInfo->addTo(iTo);
   }
   { 
      assert ( m_overlayLogo );
      m_overlayLogo->addTo(iTo);
   }

   m_viewContext->getEnergyScale()->addTo(iTo);
}
void FWEveView::addToOrthoCamera ( TGLOrthoCamera *  camera,
FWConfiguration iTo 
) const [protected]

Definition at line 405 of file FWEveView.cc.

References FWConfiguration::addKeyValue(), i, mergeVDriftHistosByStation::name, alignCSCRings::s, and FWViewBase::typeName().

Referenced by FWRPZView::addTo(), and FWLegoViewBase::addTo().

{
   // zoom
   std::ostringstream s;
   s<<(camera->fZoom);
   std::string name("cameraZoom");
   iTo.addKeyValue(name+typeName(),FWConfiguration(s.str()));
   
   // transformation matrix
   std::string matrixName("cameraMatrix");
   for ( unsigned int i = 0; i < 16; ++i ) {
      std::ostringstream osIndex;
      osIndex << i;
      std::ostringstream osValue;
      osValue << camera->GetCamTrans()[i];
      iTo.addKeyValue(matrixName+osIndex.str()+typeName(),FWConfiguration(osValue.str()));
   }   
}
void FWEveView::addToPerspectiveCamera ( TGLPerspectiveCamera *  cam,
const std::string &  name,
FWConfiguration iTo 
) const [protected]

Definition at line 461 of file FWEveView.cc.

References FWConfiguration::addKeyValue(), i, and mergeVDriftHistosByStation::name.

Referenced by FW3DViewBase::addTo(), FWLegoViewBase::addTo(), and FWGlimpseView::addTo().

{   
   // transformation matrix
   std::string matrixName("cameraMatrix");
   for ( unsigned int i = 0; i < 16; ++i ){
      std::ostringstream osIndex;
      osIndex << i;
      std::ostringstream osValue;
      osValue << (cam->GetCamTrans())[i];
      iTo.addKeyValue(matrixName+osIndex.str()+name,FWConfiguration(osValue.str()));
   }
   
   // transformation matrix base
   matrixName = "cameraMatrixBase";
   for ( unsigned int i = 0; i < 16; ++i ){
      std::ostringstream osIndex;
      osIndex << i;
      std::ostringstream osValue;
      osValue << (cam->GetCamBase())[i];
      iTo.addKeyValue(matrixName+osIndex.str()+name,FWConfiguration(osValue.str()));
   }
   {
      std::ostringstream osValue;
      osValue << cam->fFOV;
      iTo.addKeyValue(name+" FOV",FWConfiguration(osValue.str()));
   }
}
void FWEveView::cameraGuideChanged ( ) [protected, virtual]

Definition at line 234 of file FWEveView.cc.

References m_cameraGuide, m_showCameraGuide, FWGenericParameter< T >::value(), and viewerGL().

Referenced by FWEveView().

{
   m_cameraGuide->SetBinaryState(m_showCameraGuide.value());
   viewerGL()->Changed();
   gEve->Redraw3D();
}
const fireworks::Context& FWEveView::context ( ) [inline]
FWViewContextMenuHandlerBase * FWEveView::contextMenuHandler ( ) const [virtual]

Reimplemented from FWViewBase.

Definition at line 193 of file FWEveView.cc.

References m_viewContextMenu.

                                    {
   return dynamic_cast<FWViewContextMenuHandlerBase*> (m_viewContextMenu.get());
}
void FWEveView::eventBegin ( ) [virtual]

Reimplemented in FWRPZView.

Definition at line 242 of file FWEveView.cc.

{
}
void FWEveView::eventEnd ( ) [virtual]
TEveScene* FWEveView::eventScene ( ) [inline]
TEveScene* FWEveView::geoScene ( ) [inline]
virtual TEveCaloViz* FWEveView::getEveCalo ( ) const [inline, protected, virtual]

Reimplemented in FW3DView, FWLegoViewBase, and FWRPZView.

Definition at line 95 of file FWEveView.h.

Referenced by setupEnergyScale(), and voteCaloMaxVal().

{ return 0; }
bool FWEveView::isEnergyScaleGlobal ( ) const [virtual]

Definition at line 277 of file FWEveView.cc.

References m_useGlobalEnergyScale, and FWGenericParameter< T >::value().

const FWEveView& FWEveView::operator= ( const FWEveView ) [private]
TEveElement* FWEveView::ownedProducts ( ) [inline]

Definition at line 79 of file FWEveView.h.

References m_ownedProducts.

Referenced by FWEveViewManager::finishViewCreate().

{ return m_ownedProducts; }
void FWEveView::pointLineScalesChanged ( ) [protected, virtual]

Definition at line 221 of file FWEveView.cc.

References m_lineOutlineScale, m_lineSmooth, m_lineWidth, m_lineWireframeScale, m_pointSize, m_pointSmooth, FWGenericParameter< T >::value(), and viewerGL().

Referenced by FWEveView().

{
   viewerGL()->SetSmoothPoints(m_pointSmooth.value());
   viewerGL()->SetPointScale  (m_pointSize.value());
   viewerGL()->SetSmoothLines (m_lineSmooth.value());
   viewerGL()->SetLineScale   (m_lineWidth.value());
   viewerGL()->SetOLLineW     (m_lineOutlineScale.value());
   viewerGL()->SetWFLineW     (m_lineWireframeScale.value());
   viewerGL()->Changed();
   gEve->Redraw3D();
}
void FWEveView::populateController ( ViewerParameterGUI gui) const [virtual]
void FWEveView::resetCamera ( ) [protected, virtual]

Definition at line 260 of file FWEveView.cc.

References viewerGL().

{
   viewerGL()->ResetCurrentCamera();
}
void FWEveView::saveImageTo ( const std::string &  iName) const [virtual]

Implements FWViewBase.

Definition at line 204 of file FWEveView.cc.

References fwLog, fwlog::kInfo, m_imageScale, summarizeEdmComparisonLogfiles::succeeded, FWGenericParameter< T >::value(), and viewerGL().

{
   bool succeeded = false;
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
   succeeded = viewerGL()->SavePictureScale(iName, m_imageScale.value());
#else
   succeeded = viewerGL()->SavePicture(iName.c_str());
#endif

   if(!succeeded) {
      throw std::runtime_error("Unable to save picture");
   }
   fwLog(fwlog::kInfo) <<  "Saved image " << iName << std::endl;
}
void FWEveView::setBackgroundColor ( Color_t  iColor) [virtual]

Reimplemented in FWEveLegoView.

Definition at line 254 of file FWEveView.cc.

References FWColorManager::setColorSetViewer(), and viewerGL().

void FWEveView::setContext ( const fireworks::Context x) [virtual]

Reimplemented in FW3DView, FW3DViewBase, FWEveLegoView, FWHFView, FWLegoViewBase, and FWRPZView.

Definition at line 267 of file FWEveView.cc.

References context(), m_context, m_useGlobalEnergyScale, m_viewContext, FWGenericParameter< T >::value(), and x.

Referenced by FWEveViewManager::finishViewCreate().

{
   m_context = &x ;

   // in constructor view context has local scale
   if (m_useGlobalEnergyScale.value()) 
      m_viewContext->setEnergyScale(context().commonPrefs()->getEnergyScale());
}
void FWEveView::setFrom ( const FWConfiguration iFrom) [virtual]

Reimplemented from FWConfigurableParameterizable.

Reimplemented in FW3DViewBase, FWGlimpseView, FWLegoViewBase, and FWRPZView.

Definition at line 356 of file FWEveView.cc.

References FWParameterizable::begin(), FWParameterizable::end(), m_localEnergyScale, m_overlayEventInfo, m_overlayLogo, FWEventAnnotation::setFrom(), CmsAnnotation::setFrom(), FWConfigurableParameterizable::version(), FWConfiguration::version(), and viewerGL().

{
   // Make sure you change the version ranges here
   // whenever you update the logic.
   // The rationale should be:
   // (version range supported by the next block) && (version range in the configuration file)
   //
   // This is not "forward" compatible, but I don't think
   // we care.
   if (version() >= 2 && iFrom.version() >= 1)
   {
      for(const_iterator it =begin(), itEnd = end();
          it != itEnd;
          ++it) {
         (*it)->setFrom(iFrom);      
      }  
   }
   if (iFrom.version() > 1)
   {
      assert( m_overlayEventInfo);
      m_overlayEventInfo->setFrom(iFrom);
   }
   {
      assert( m_overlayLogo);
      m_overlayLogo->setFrom(iFrom);
   }
   
   if (iFrom.version() > 4)
   {
      m_localEnergyScale->setFrom(iFrom);
   }


   // selection clors
   UChar_t* ca = 0;
   ca = gEve->GetDefaultGLViewer()->RefLightColorSet().Selection(1).Arr();
   viewerGL()->RefLightColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
   ca = gEve->GetDefaultGLViewer()->RefLightColorSet().Selection(3).Arr();
   viewerGL()->RefLightColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
   ca = gEve->GetDefaultGLViewer()->RefDarkColorSet().Selection(1).Arr();
   viewerGL()->RefDarkColorSet().Selection(1).SetColor(ca[0], ca[1], ca[2]);
   ca = gEve->GetDefaultGLViewer()->RefDarkColorSet().Selection(3).Arr();
   viewerGL()->RefDarkColorSet().Selection(3).SetColor(ca[0], ca[1], ca[2]);
}
void FWEveView::setFromOrthoCamera ( TGLOrthoCamera *  camera,
const FWConfiguration iFrom 
) [protected]

Definition at line 425 of file FWEveView.cc.

References fwLog, i, fwlog::kInfo, alignCSCRings::s, FWViewBase::typeName(), FWConfiguration::value(), relativeConstraints::value, FWConfiguration::valueForKey(), and viewerGL().

Referenced by FWLegoViewBase::setFrom(), and FWRPZView::setFrom().

{
   try {
      // zoom
      std::string zoomName("cameraZoom"); zoomName += typeName();
      if (iFrom.valueForKey(zoomName) == 0 )
      {
         throw std::runtime_error("can't restore parameter cameraZoom");
      }
      std::istringstream s(iFrom.valueForKey(zoomName)->value());
      s>>(camera->fZoom);
      
      // transformation matrix
      std::string matrixName("cameraMatrix");
      for ( unsigned int i = 0; i < 16; ++i ) {
         std::ostringstream os;
         os << i;
         const FWConfiguration* value = iFrom.valueForKey( matrixName + os.str() + typeName() );
         if ( value ==  0 )
         {
            throw std::runtime_error ("can't restore parameter cameraMatrix.");
         }
         std::istringstream s(value->value());
         s>> (camera->RefCamTrans()[i]);
      }
   }
   catch (const std::runtime_error& iException)
   {
      fwLog(fwlog::kInfo) << "Caught exception while restoring camera parameters in view " << typeName() << "\n.";
      viewerGL()->ResetCamerasAfterNextUpdate();      

   }
   camera->IncTimeStamp();
}
void FWEveView::setFromPerspectiveCamera ( TGLPerspectiveCamera *  cam,
const std::string &  name,
const FWConfiguration iFrom 
) [protected]

Definition at line 490 of file FWEveView.cc.

References fwLog, i, fwlog::kDebug, fwlog::kInfo, mergeVDriftHistosByStation::name, alignCSCRings::s, FWViewBase::typeName(), FWConfiguration::value(), relativeConstraints::value, FWConfiguration::valueForKey(), and viewerGL().

Referenced by FWLegoViewBase::setFrom(), FW3DViewBase::setFrom(), and FWGlimpseView::setFrom().

{
   try {
      std::string matrixName("cameraMatrix");
      for ( unsigned int i = 0; i < 16; ++i ){
         std::ostringstream os;
         os << i;
         const FWConfiguration* value = iFrom.valueForKey( matrixName + os.str() + name );
         if ( value ==  0 )
         {
            throw std::runtime_error ("can't restore parameter cameraMatrix.");
         }
         std::istringstream s(value->value());
         s>>((cam->RefCamTrans())[i]);
      }
      
      // transformation matrix base
      matrixName = "cameraMatrixBase";
      for ( unsigned int i = 0; i < 16; ++i ){
         std::ostringstream os;
         os << i;
         const FWConfiguration* value = iFrom.valueForKey( matrixName + os.str() + name );
         if ( value ==  0 )
         {
            throw std::runtime_error ("can't restore parameter cameraMatrixBase.");
         }
     
         std::istringstream s(value->value());
         s>>((cam->RefCamBase())[i]);
      }
      
      {
         const FWConfiguration* value = iFrom.valueForKey( name + " FOV" );
         if ( value ==  0 )
         {
            throw std::runtime_error ("can't restore parameter cameraMatrixBase.");
         }
         std::istringstream s(value->value());
         s>>cam->fFOV;
      }
      
      cam->IncTimeStamp();
   }
   catch (const std::runtime_error& iException)
   {
      fwLog(fwlog::kInfo) << "Caught exception while restoring camera parameters in view " << typeName() << "\n.";
      viewerGL()->ResetCamerasAfterNextUpdate();  
      fwLog(fwlog::kDebug) << "Reset camera fo view "  << typeName() << "\n.";
   }
}
void FWEveView::setupEnergyScale ( ) [virtual]

Definition at line 299 of file FWEveView.cc.

References context(), f, FWViewContext::getEnergyScale(), getEveCalo(), fireworks::Context::getMaxEnergyInEvent(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), FWViewEnergyScale::getScaleFactorLego(), FWViewType::isLego(), Pi, FWViewContext::scaleChanged(), FWViewBase::typeId(), FWViewEnergyScale::updateScaleFactors(), viewContext(), and voteCaloMaxVal().

Referenced by eventEnd(), FWEveView(), FWRPZView::setEtaRng(), and useGlobalEnergyScaleChanged().

{
   // Called at end of event OR if scale parameters changed.

   FWViewEnergyScale*  energyScale = viewContext()->getEnergyScale();
   // printf("setupEnergyScale %s >> scale name %s\n", typeName().c_str(), energyScale->name().c_str());
   voteCaloMaxVal();
   
   // set cache for energy to lenght conversion
   float maxVal = context().getMaxEnergyInEvent(energyScale->getPlotEt());
   energyScale->updateScaleFactors(maxVal);
   // printf("max event val %f \n", maxVal);
   // printf("scales lego %f \n",  energyScale->getScaleFactorLego());

   // configure TEveCaloViz
   TEveCaloViz* calo = getEveCalo();
   if (calo)
   {
      calo->SetPlotEt(energyScale->getPlotEt());
      if (FWViewType::isLego(typeId()))
      {
         float f = energyScale->getScaleFactorLego();
         calo->SetMaxValAbs(TMath::Pi()/f);
      }
      else
      {
         float f = energyScale->getScaleFactor3D();
         calo->SetMaxValAbs(100/f);
      }
      calo->ElementChanged();
   }

   // emit signal to proxy builders 
   viewContext()->scaleChanged();
   gEve->Redraw3D();
}
void FWEveView::useGlobalEnergyScaleChanged ( ) [virtual]
FWViewContext* FWEveView::viewContext ( ) [inline]

Definition at line 80 of file FWEveView.h.

References m_viewContext.

Referenced by FWEveViewManager::beingDestroyed(), FWEveViewManager::newItem(), and setupEnergyScale().

{ return m_viewContext.get(); }
TEveViewer* FWEveView::viewer ( ) [inline]

Definition at line 75 of file FWEveView.h.

References m_viewer.

Referenced by FWGlimpseView::FWGlimpseView().

{ return m_viewer; }
TGLViewer * FWEveView::viewerGL ( ) const
void FWEveView::voteCaloMaxVal ( ) [virtual]

Reimplemented in FWRPZView.

Definition at line 291 of file FWEveView.cc.

References context(), getEveCalo(), and fireworks::Context::voteMaxEtAndEnergy().

Referenced by setupEnergyScale().

{
   TEveCaloViz* calo = getEveCalo();
   if (calo)
      context().voteMaxEtAndEnergy(calo->GetData()->GetMaxVal(1), calo->GetData()->GetMaxVal(0));
}

Member Data Documentation

TGLCameraGuide* FWEveView::m_cameraGuide [private]

Definition at line 119 of file FWEveView.h.

Referenced by cameraGuideChanged(), and FWEveView().

Definition at line 121 of file FWEveView.h.

Referenced by context(), and setContext().

Definition at line 131 of file FWEveView.h.

Referenced by FWEveView(), and populateController().

Definition at line 118 of file FWEveView.h.

Referenced by FWEveView().

Definition at line 130 of file FWEveView.h.

Referenced by FWEveView(), and populateController().

TEveScene* FWEveView::m_eventScene [private]

Definition at line 112 of file FWEveView.h.

Referenced by eventScene(), FWEveView(), and ~FWEveView().

TEveScene* FWEveView::m_geoScene [private]

Definition at line 114 of file FWEveView.h.

Referenced by FWEveView(), geoScene(), and ~FWEveView().

Definition at line 128 of file FWEveView.h.

Referenced by populateController(), and saveImageTo().

Definition at line 137 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

Definition at line 135 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

Definition at line 136 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

Definition at line 138 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

Definition at line 145 of file FWEveView.h.

Referenced by FWEveView(), populateController(), setFrom(), and useGlobalEnergyScaleChanged().

Definition at line 116 of file FWEveView.h.

Referenced by addTo(), eventEnd(), FWEveView(), and setFrom().

Definition at line 117 of file FWEveView.h.

Referenced by addTo(), FWEveView(), and setFrom().

TEveElement* FWEveView::m_ownedProducts [private]

Definition at line 113 of file FWEveView.h.

Referenced by FWEveView(), and ownedProducts().

Definition at line 134 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

Definition at line 133 of file FWEveView.h.

Referenced by FWEveView(), pointLineScalesChanged(), and populateController().

Definition at line 140 of file FWEveView.h.

Referenced by cameraGuideChanged(), FWEveView(), and populateController().

std::auto_ptr<FWViewContext> FWEveView::m_viewContext [private]

Definition at line 144 of file FWEveView.h.

Referenced by addTo(), FWEveView(), setContext(), useGlobalEnergyScaleChanged(), and viewContext().

Definition at line 143 of file FWEveView.h.

Referenced by contextMenuHandler(), and FWEveView().

Definition at line 147 of file FWEveView.h.

Referenced by populateController(), and useGlobalEnergyScaleChanged().

TEveViewer* FWEveView::m_viewer [private]

Definition at line 111 of file FWEveView.h.

Referenced by FWEveView(), viewer(), viewerGL(), and ~FWEveView().