CMS 3D CMS Logo

Public Member Functions | Private Attributes

FWGeometryTableViewBase::FWViewCombo Class Reference

#include <FWGeometryTableViewBase.h>

List of all members.

Public Member Functions

 FWViewCombo (const TGWindow *p, FWGeometryTableViewBase *t)
virtual Bool_t HandleButton (Event_t *event)
void setElement (TEveElement *x)
virtual ~FWViewCombo ()

Private Attributes

TEveElement * m_el
FWGeometryTableViewBasem_tableView

Detailed Description

Definition at line 50 of file FWGeometryTableViewBase.h.


Constructor & Destructor Documentation

FWGeometryTableViewBase::FWViewCombo::FWViewCombo ( const TGWindow *  p,
FWGeometryTableViewBase t 
) [inline]

Definition at line 56 of file FWGeometryTableViewBase.h.

                                                                : 
         TGTextButton(p, "Select Views", -1, TGButton::GetDefaultGC()(), TGTextButton::GetDefaultFontStruct(), kRaisedFrame | kDoubleBorder  ), m_tableView(t), m_el(0) {}
virtual FWGeometryTableViewBase::FWViewCombo::~FWViewCombo ( ) [inline, virtual]

Definition at line 58 of file FWGeometryTableViewBase.h.

{}

Member Function Documentation

Bool_t FWGeometryTableViewBase::FWViewCombo::HandleButton ( Event_t *  event) [virtual]

Definition at line 51 of file FWGeometryTableViewBase.cc.

References create_public_lumi_plots::ax, fwLog, customizeTrackingMonitorSeedNumber::idx, fwlog::kInfo, m_el, m_tableView, Association::map, alignCSCRings::s, and findQualityFiles::v.

{
   if (event->fType == kButtonPress)
   {
      bool map = false;

      FWPopupMenu* m_viewPopup = new FWPopupMenu(0);

      TEveElementList* views = gEve->GetViewers();
      int idx = 0;

      for (TEveElement::List_i it = views->BeginChildren(); it != views->EndChildren(); ++it)
      { 
         TEveViewer* v = ((TEveViewer*)(*it));
         if (strstr( v->GetElementName(), "3D") )
         {     
            bool added = false;          
            m_viewPopup->AddEntry(v->GetElementName(), idx);

            for (TEveElement::List_i eit = v->BeginChildren(); eit != v->EndChildren(); ++eit )
            {
               TEveScene* s = ((TEveSceneInfo*)*eit)->GetScene();
               if (m_el && s->HasChildren() && s->FirstChild() == m_el) {
                  added = true;
                  break;
               }
            }
            map = true;
            if (added)
               m_viewPopup->CheckEntry(idx);
         }
         ++idx;
      }

      if (map) {

         Window_t wdummy;
         Int_t ax,ay;
         gVirtualX->TranslateCoordinates(GetId(),
                                         gClient->GetDefaultRoot()->GetId(),
                                         event->fX, event->fY, //0,0 in local coordinates
                                         ax,ay, //coordinates of screen
                                         wdummy);


         m_viewPopup->PlaceMenu(ax, ay, true,true);
         m_viewPopup->Connect("Activated(Int_t)",
                              "FWGeometryTableViewBase",
                              const_cast<FWGeometryTableViewBase*>(m_tableView),
                              "selectView(Int_t)");
      }
      else
      {
         fwLog(fwlog::kInfo) << "No 3D View added. \n";
      }
   }
   return true;
}
void FWGeometryTableViewBase::FWViewCombo::setElement ( TEveElement *  x) [inline]

Member Data Documentation

Definition at line 54 of file FWGeometryTableViewBase.h.

Referenced by HandleButton(), and setElement().

Definition at line 53 of file FWGeometryTableViewBase.h.

Referenced by HandleButton().