CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

FWGeometryTableView Class Reference

#include <Fireworks/Core/interface/FWGeometryTableView.h>

Inheritance diagram for FWGeometryTableView:
FWGeometryTableViewBase FWViewBase FWParameterSetterEditorBase FWConfigurableParameterizable FWParameterizable FWConfigurable

List of all members.

Public Types

enum  EFiterType { kFilterMaterialName, kFilterMaterialTitle, kFilterShapeName, kFilterShapeClassName }
enum  EMode { kNode, kVolume }
enum  EProximityAlgo { kBBoxCenter, kBBoxSurface }

Public Member Functions

void autoExpandCallback ()
void checkRegionOfInterest ()
bool drawTopNode () const
void filterListCallback ()
void filterTextEntryCallback ()
 FWGeometryTableView (TEveWindowSlot *iParent, FWColorManager *colMng)
int getAutoExpand () const
std::string getFilter () const
int getFilterType () const
bool getIgnoreVisLevelWhenFilter () const
virtual
FWGeometryTableManagerBase
getTableManager ()
int getVisLevel () const
bool getVolumeMode () const
bool isSelectedByRegion () const
virtual void populateController (ViewerParameterGUI &) const
virtual void setFrom (const FWConfiguration &)
virtual void setPath (int, std::string &)
void updateFilter (std::string &)
void updateVisibilityTopNode ()
virtual ~FWGeometryTableView ()

Private Member Functions

 ClassDef (FWGeometryTableView, 0)
 FWGeometryTableView (const FWGeometryTableView &)
const FWGeometryTableViewoperator= (const FWGeometryTableView &)

Private Attributes

FWBoolParameter m_disableTopNode
FWStringParameter m_filter
FWGUIValidatingTextEntrym_filterEntry
FWEnumParameter m_filterType
boost::shared_ptr
< FWParameterSetterBase
m_filterTypeSetter
FWGeoMaterialValidatorm_filterValidator
FWEnumParameter m_mode
FWEnumParameter m_proximityAlgo
FWDoubleParameter m_regionRadius
FWBoolParameter m_selectRegion
FWGeometryTableManagerm_tableManager
FWLongParameter m_visLevel
FWBoolParameter m_visLevelFilter

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 29 of file FWGeometryTableView.h.


Member Enumeration Documentation

Enumerator:
kFilterMaterialName 
kFilterMaterialTitle 
kFilterShapeName 
kFilterShapeClassName 

Definition at line 34 of file FWGeometryTableView.h.

Enumerator:
kNode 
kVolume 

Definition at line 32 of file FWGeometryTableView.h.

{ kNode, kVolume };
Enumerator:
kBBoxCenter 
kBBoxSurface 

Definition at line 33 of file FWGeometryTableView.h.


Constructor & Destructor Documentation

FWGeometryTableView::FWGeometryTableView ( TEveWindowSlot *  iParent,
FWColorManager colMng 
)

Definition at line 133 of file FWGeometryTableView.cc.

References FWEnumParameter::addEntry(), autoExpandCallback(), FWGeometryTableViewBase::cdTop(), FWGenericParameter< T >::changed_, checkRegionOfInterest(), FWGeometryTableViewManager::getGeoMangeur(), FWGUIValidatingTextEntry::getListBox(), kBBoxCenter, kBBoxSurface, kFilterMaterialName, kFilterMaterialTitle, kFilterShapeClassName, kFilterShapeName, kNode, kVolume, FWGeometryTableManager::loadGeometry(), FWGeometryTableViewBase::m_autoExpand, m_disableTopNode, FWGeometryTableViewBase::m_eveScene, FWGeometryTableViewBase::m_eveTopNode, FWGeoTopNodeGLScene::m_eveTopNode, m_filterEntry, m_filterType, m_filterTypeSetter, m_filterValidator, FWGeometryTableViewBase::m_frame, m_mode, m_proximityAlgo, m_regionRadius, FWGeoTopNode::m_scene, m_selectRegion, m_tableManager, FWGeometryTableViewBase::m_viewBox, m_visLevel, m_visLevelFilter, FWParameterSetterBase::makeSetterFor(), FWGeometryTableViewBase::postConst(), FWGeometryTableViewBase::refreshTable3D(), FWGUIValidatingTextEntry::setMaxListBoxHeight(), FWGUIValidatingTextEntry::setValidator(), and updateVisibilityTopNode().

   : FWGeometryTableViewBase(iParent, FWViewType::kGeometryTable, colMng),
     m_tableManager(0),
     m_filterEntry(0),
     m_filterValidator(0),
     m_mode(this, "Mode", 0l, 0l, 1l),
     m_disableTopNode(this,"HideTopNode", true),
     m_visLevel(this,"VisLevel", 3l, 1l, 100l),
     m_filter(this,"Materials", std::string()),
     m_filterType(this,"FilterType:", 0l, 0l, 3l),
     m_visLevelFilter(this,"IgnoreVisLevelOnFilter", true),
     m_selectRegion(this, "SelectNearCameraCenter", false),
     m_regionRadius(this, "SphereRadius", 10.0, 1.0, 300.0),
     m_proximityAlgo(this, "Proximity algorithm", 1l, 0l, 1l)
{
   FWGeoTopNodeGLScene *gls = new FWGeoTopNodeGLScene(0);
#if ROOT_VERSION_CODE < ROOT_VERSION(5,32,0)
   m_eveScene  = new  FWGeoTopNodeEveScene(gls, "TopGeoNodeScene", "");
#else
   m_eveScene  = new  TEveScene(gls, "TopGeoNodeScene", "");
#endif
   gEve->GetScenes()->AddElement(m_eveScene);

   m_eveTopNode = new  FWEveDetectorGeo(this);
   m_eveTopNode->IncDenyDestroy();
   m_eveTopNode->SetPickable(true);
   m_eveScene->AddElement(m_eveTopNode);

   gls->m_eveTopNode = m_eveTopNode;
   m_eveTopNode->m_scene   = gls;

   // top row
   TGHorizontalFrame *hp = new TGHorizontalFrame(m_frame);
   {
      TGTextButton *rb = new TGTextButton (hp, "CdTop");
      hp->AddFrame(rb, new TGLayoutHints(kLHintsNormal, 2, 2, 0, 0) );
      rb->Connect("Clicked()","FWGeometryTableViewBase",this,"cdTop()");
   } 
   {
      TGTextButton *rb = new TGTextButton (hp, "CdUp");
      hp->AddFrame(rb, new TGLayoutHints(kLHintsNormal, 2, 2, 0, 0));
      rb->Connect("Clicked()","FWGeometryTableViewBase",this,"cdUp()");
   }
   {
      m_viewBox = new FWViewCombo(hp, this);
      hp->AddFrame( m_viewBox,new TGLayoutHints(kLHintsExpandY, 2, 2, 0, 0));
   }
   {

      m_filterType.addEntry(kFilterMaterialName,   "MaterialName");
      m_filterType.addEntry(kFilterMaterialTitle,  "MaterialTitle");
      m_filterType.addEntry(kFilterShapeName,      "ShapeName");
      m_filterType.addEntry(kFilterShapeClassName, "ShapeClassName");

      boost::shared_ptr<FWParameterSetterBase> ptr( FWParameterSetterBase::makeSetterFor((FWParameterBase*)&m_filterType) );
      ptr->attach((FWParameterBase*)&m_filterType, this);

      TGFrame* pframe = ptr->build(hp, false);
      hp->AddFrame(pframe, new TGLayoutHints(kLHintsLeft));
      m_filterTypeSetter.swap(ptr);
   }
   {
      hp->AddFrame(new TGLabel(hp, "FilterExp:"), new TGLayoutHints(kLHintsBottom, 0, 0, 0, 2));
      m_filterEntry = new FWGUIValidatingTextEntry(hp);
      m_filterEntry->SetHeight(20);
      m_filterValidator = new FWGeoMaterialValidator(this);
      m_filterEntry->setValidator(m_filterValidator);
      hp->AddFrame(m_filterEntry, new TGLayoutHints(kLHintsExpandX,  0, 2, 1, 0));
      m_filterEntry->setMaxListBoxHeight(150);
      m_filterEntry->getListBox()->Connect("Selected(int)", "FWGeometryTableView",  this, "filterListCallback()");
      m_filterEntry->Connect("ReturnPressed()", "FWGeometryTableView",  this, "filterTextEntryCallback()");

      gVirtualX->GrabKey( m_filterEntry->GetId(),gVirtualX->KeysymToKeycode((int)kKey_A),  kKeyControlMask, true);
   }
   m_frame->AddFrame(hp,new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 2, 2, 2, 0));

   m_tableManager = new FWGeometryTableManager(this);
   {
      TEveGeoManagerHolder gmgr( FWGeometryTableViewManager::getGeoMangeur());
      m_tableManager->loadGeometry( gGeoManager->GetTopNode(), gGeoManager->GetListOfVolumes());
   }
   cdTop();

   m_mode.addEntry(kNode,   "Node");
   m_mode.addEntry(kVolume, "Volume");

   m_mode.changed_.connect(boost::bind(&FWGeometryTableView::refreshTable3D,this));
   m_autoExpand.changed_.connect(boost::bind(&FWGeometryTableView::autoExpandCallback, this));
   m_visLevel.changed_.connect(boost::bind(&FWGeometryTableView::refreshTable3D,this));
   
   
   m_visLevelFilter.changed_.connect(boost::bind(&FWGeometryTableView::refreshTable3D,this));

   m_disableTopNode.changed_.connect(boost::bind(&FWGeometryTableView::updateVisibilityTopNode,this));
   postConst();

   m_proximityAlgo.addEntry(kBBoxCenter,  "BBox center");
   m_proximityAlgo.addEntry(kBBoxSurface, "BBox surface");

   m_selectRegion.changed_.connect(boost::bind(&FWGeometryTableView::checkRegionOfInterest,this));
   m_regionRadius.changed_.connect(boost::bind(&FWGeometryTableView::checkRegionOfInterest,this));
   m_proximityAlgo.changed_.connect(boost::bind(&FWGeometryTableView::checkRegionOfInterest,this));
   
}
FWGeometryTableView::~FWGeometryTableView ( ) [virtual]

Definition at line 238 of file FWGeometryTableView.cc.

{}
FWGeometryTableView::FWGeometryTableView ( const FWGeometryTableView ) [private]

Member Function Documentation

void FWGeometryTableView::autoExpandCallback ( )
void FWGeometryTableView::checkRegionOfInterest ( )

Definition at line 367 of file FWGeometryTableView.cc.

References FWGeometryTableManager::checkRegionOfInterest(), fwLog, fwlog::kError, fwlog::kInfo, fwlog::kWarning, FWGeometryTableViewBase::m_eveTopNode, m_proximityAlgo, m_regionRadius, m_selectRegion, m_tableManager, FWGeometryTableViewBase::refreshTable3D(), FWGeometryTableManager::resetRegionOfInterest(), v, FWGenericParameter< T >::value(), and viewIsChecked().

Referenced by FWGeometryTableView().

{
   if (m_selectRegion.value())
   {
      double* center = 0;
      for (TEveElement::List_i it = gEve->GetViewers()->BeginChildren(); it != gEve->GetViewers()->EndChildren(); ++it)
      { 
         TEveViewer* v = ((TEveViewer*)(*it));
         if (viewIsChecked(v, m_eveTopNode))
         {
            if (center) {
               fwLog(fwlog::kWarning) << "Center picked from first view \n";
            } else {
               center = v->GetGLViewer()->CurrentCamera().GetCenterVec();
               fwLog(fwlog::kInfo) << Form("Center picked (%.1f, %.1f, %.1f) from first selected 3D view \n", 
                                           center[0], center[1], center[2]);
            }
         }
      } 

      if (! center)
      {
         fwLog(fwlog::kError) << "No 3D view selected \n";
         return;
      }
      
      m_tableManager->checkRegionOfInterest(center, m_regionRadius.value(), m_proximityAlgo.value());
   }
   else 
   {
      m_tableManager->resetRegionOfInterest();
   }

   refreshTable3D();
}
FWGeometryTableView::ClassDef ( FWGeometryTableView  ,
 
) [private]
bool FWGeometryTableView::drawTopNode ( ) const [inline]
void FWGeometryTableView::filterListCallback ( )

Definition at line 277 of file FWGeometryTableView.cc.

References funct::exp(), m_filterEntry, and updateFilter().

{ 
   // std::cout << "list click ed [" << m_filterEntry->GetText() << "] \n" ;

   std::string exp = m_filterEntry->GetText();
   updateFilter(exp);
}
void FWGeometryTableView::filterTextEntryCallback ( )

Definition at line 269 of file FWGeometryTableView.cc.

References funct::exp(), m_filterEntry, and updateFilter().

{
   // std::cout << "text entry click ed \n" ;
   std::string exp = m_filterEntry->GetText();
   updateFilter(exp);
}
int FWGeometryTableView::getAutoExpand ( ) const [inline]
std::string FWGeometryTableView::getFilter ( ) const [inline]
int FWGeometryTableView::getFilterType ( ) const [inline]
bool FWGeometryTableView::getIgnoreVisLevelWhenFilter ( ) const [inline]
FWGeometryTableManagerBase * FWGeometryTableView::getTableManager ( ) [virtual]
int FWGeometryTableView::getVisLevel ( ) const [inline]

Definition at line 49 of file FWGeometryTableView.h.

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

Referenced by FWEveDetectorGeo::Paint().

{ return m_visLevel.value(); }
bool FWGeometryTableView::getVolumeMode ( ) const [inline]
bool FWGeometryTableView::isSelectedByRegion ( ) const [inline]
const FWGeometryTableView& FWGeometryTableView::operator= ( const FWGeometryTableView ) [private]
void FWGeometryTableView::populateController ( ViewerParameterGUI gui) const [virtual]

Reimplemented from FWGeometryTableViewBase.

Definition at line 312 of file FWGeometryTableView.cc.

References ViewerParameterGUI::getTabContainer(), FWGeometryTableViewBase::m_autoExpand, m_disableTopNode, FWGeometryTableViewBase::m_minLeafTransparency, FWGeometryTableViewBase::m_minParentTransparency, m_mode, m_proximityAlgo, m_regionRadius, m_selectRegion, m_visLevel, m_visLevelFilter, ViewerParameterGUI::requestTab(), and ViewerParameterGUI::separator().

{
  gui.requestTab("Style").
    addParam(&m_mode).
    addParam(&m_autoExpand).
    separator().
    addParam(&m_disableTopNode).
    addParam(&m_minParentTransparency).
    addParam(&m_minLeafTransparency).
    addParam(&m_visLevel).
    addParam(&m_visLevelFilter).
    separator().
    addParam(&m_selectRegion).
    addParam(&m_regionRadius).
    addParam(&m_proximityAlgo).separator();

   TGTextButton* butt = new TGTextButton(gui.getTabContainer(), "ReloadColors");
   gui.getTabContainer()->AddFrame(butt);
   butt->Connect("Clicked()", "FWGeometryTableViewBase", (FWGeometryTableViewBase*)this, "reloadColors()");
}
void FWGeometryTableView::setFrom ( const FWConfiguration iFrom) [virtual]
void FWGeometryTableView::setPath ( int  parentIdx,
std::string &   
) [virtual]
void FWGeometryTableView::updateFilter ( std::string &  exp)
void FWGeometryTableView::updateVisibilityTopNode ( )

Member Data Documentation

Definition at line 83 of file FWGeometryTableView.h.

Referenced by getFilter(), setFrom(), and updateFilter().

Definition at line 84 of file FWGeometryTableView.h.

Referenced by FWGeometryTableView(), getFilterType(), setFrom(), and updateFilter().

Definition at line 92 of file FWGeometryTableView.h.

Referenced by FWGeometryTableView(), and setFrom().

Definition at line 76 of file FWGeometryTableView.h.

Referenced by FWGeometryTableView().

Definition at line 79 of file FWGeometryTableView.h.

Referenced by FWGeometryTableView(), getVolumeMode(), and populateController().

Definition at line 81 of file FWGeometryTableView.h.

Referenced by FWGeometryTableView(), getVisLevel(), and populateController().