CMS 3D CMS Logo

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

FWOverlapTableView Class Reference

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

Inheritance diagram for FWOverlapTableView:
FWGeometryTableViewBase FWViewBase FWParameterSetterEditorBase FWConfigurableParameterizable FWParameterizable FWConfigurable

List of all members.

Public Member Functions

virtual void cdTop ()
virtual void cdUp ()
virtual void chosenItem (int x)
 ClassDef (FWOverlapTableView, 0)
void drawPoints ()
 FWOverlapTableView (TEveWindowSlot *iParent, FWColorManager *colMng)
virtual
FWGeometryTableManagerBase
getTableManager ()
bool listAllNodes () const
void pointSize ()
virtual void populateController (ViewerParameterGUI &) const
void precisionCallback (Long_t)
void recalculate ()
virtual void refreshTable3D ()
virtual void setFrom (const FWConfiguration &)
void setListAllNodes ()
virtual ~FWOverlapTableView ()

Public Attributes

FWBoolParameter m_drawPoints
FWLongParameter m_extrusionMarkerColor
FWBoolParameter m_listAllNodes
TGNumberEntry * m_numEntry
FWLongParameter m_overlapMarkerColor
FWStringParameter m_path
FWLongParameter m_pointSize
FWDoubleParameter m_precision
FWBoolParameter m_rnrExtrusion
FWBoolParameter m_rnrOverlap
bool m_runChecker
FWOverlapTableManagerm_tableManager

Protected Member Functions

virtual TEveElement * getEveGeoElement () const

Private Member Functions

 FWOverlapTableView (const FWOverlapTableView &)
const FWOverlapTableViewoperator= (const FWOverlapTableView &)
void setCheckerState (bool)

Private Attributes

TGTextButton * m_applyButton
TGCheckButton * m_listOptionButton

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 34 of file FWOverlapTableView.h.


Constructor & Destructor Documentation

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

Definition at line 58 of file FWOverlapTableView.cc.

References FWGenericParameter< T >::changed_, drawPoints(), m_applyButton, m_drawPoints, FWGeometryTableViewBase::m_eveScene, FWGeometryTableViewBase::m_eveTopNode, FWGeoTopNodeGLScene::m_eveTopNode, m_extrusionMarkerColor, FWGeometryTableViewBase::m_frame, m_listAllNodes, m_listOptionButton, FWGeometryTableViewBase::m_marker, m_numEntry, m_overlapMarkerColor, m_pointSize, m_precision, m_rnrExtrusion, m_rnrOverlap, FWGeoTopNode::m_scene, m_tableManager, FWGeometryTableViewBase::m_viewBox, FWGenericParameterWithRange< T >::max(), FWGenericParameterWithRange< T >::min(), FWParameterBase::name(), pointSize(), FWGeometryTableViewBase::postConst(), FWGeometryTableViewBase::refreshTable3D(), refreshTable3D(), and FWGenericParameter< T >::value().

                                                                                      : 
   FWGeometryTableViewBase(iParent, FWViewType::kOverlapTable, colMng),
   m_applyButton(0),
   m_listOptionButton(0),
   m_tableManager(0),
   m_numEntry(0),
   m_runChecker(true),
   m_path(this,"Path:", std::string("/cms:World_1/cms:CMSE_1")),
   m_precision(this, "Precision", 0.05, 0.000001, 10),
   m_listAllNodes(this, "ListAllNodes", true),
   m_rnrOverlap(this, "Overlap", true),
   m_rnrExtrusion(this, "Extrusion", true),
  m_drawPoints(this, "DrawPoints", true),
  m_pointSize(this, "PointSize", 4l, 0l, 10l),
  m_extrusionMarkerColor(this, "ExtrusionMarkerColor", 0l, 0l, 20l),
  m_overlapMarkerColor(this, "OverlapMarkerColor", 9l, 0l, 20l)
{ 
   // top row
   TGHorizontalFrame* hp =  new TGHorizontalFrame(m_frame);

   {
      m_viewBox = new FWViewCombo(hp, this);
      hp->AddFrame( m_viewBox,new TGLayoutHints(kLHintsExpandY, 2, 2, 0, 0));
   }

   {
      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()");
   }
   {
      hp->AddFrame(new TGLabel(hp, "Precision:"), new TGLayoutHints(kLHintsBottom, 10, 0, 0, 2));
      m_numEntry = new TGNumberEntry(hp,  m_precision.value(), 5, -1, TGNumberFormat::kNESReal, TGNumberFormat::kNEAAnyNumber, TGNumberFormat::kNELLimitMinMax, m_precision.min(), m_precision.max());
      hp->AddFrame(m_numEntry, new TGLayoutHints(kLHintsNormal, 2, 2, 0, 0));
      m_numEntry->Connect("ValueSet(Long_t)","FWOverlapTableView",this,"precisionCallback(Long_t)");
   }

   { 
      m_listOptionButton  = new TGCheckButton(hp,m_listAllNodes.name().c_str());
      m_listOptionButton->SetState( m_listAllNodes.value() ? kButtonDown : kButtonUp );
      m_listOptionButton->Connect("Clicked()", "FWOverlapTableView", this, "setListAllNodes()");
      hp->AddFrame(m_listOptionButton, new TGLayoutHints(kLHintsLeft|kLHintsCenterY,2,0,1,1));

   }
   {
      m_applyButton = new TGTextButton (hp, "Apply");
      hp->AddFrame( m_applyButton, new TGLayoutHints(kLHintsNormal, 2, 2, 0, 0));
      m_applyButton->Connect("Clicked()","FWOverlapTableView",this,"recalculate()");
   }
   
   m_frame->AddFrame(hp,new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 4, 2, 2, 0));
   m_tableManager = new FWOverlapTableManager(this);

   // std::cerr << " FWOverlapTableView::initGeometry \n";
  
   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  FWEveOverlap(this);
   m_eveTopNode->SetElementNameTitle("overlapNode", "opverlapNodetitle");
   m_eveTopNode->IncDenyDestroy();
   m_eveTopNode->SetPickable(true);
   m_eveScene->AddElement(m_eveTopNode);

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

   m_marker = new  FWEveDigitSetScalableMarker();
   m_marker->SetMainColor(kRed);
   m_marker->IncDenyDestroy();
   m_marker->Reset(TEveQuadSet::kQT_FreeQuad, kFALSE, 32);
   m_marker->SetOwnIds(kTRUE);
   m_marker->SetAlwaysSecSelect(kTRUE);
   m_marker->SetPickable(kTRUE);
   m_marker->SetOwnIds(kTRUE);


   m_drawPoints.changed_.connect(boost::bind(&FWOverlapTableView::drawPoints,this));
   m_pointSize.changed_.connect(boost::bind(&FWOverlapTableView::pointSize,this));
   m_rnrOverlap.changed_.connect(boost::bind(&FWOverlapTableView::refreshTable3D,this));
   m_overlapMarkerColor.changed_.connect(boost::bind(&FWOverlapTableView::refreshTable3D,this));
   m_extrusionMarkerColor.changed_.connect(boost::bind(&FWOverlapTableView::refreshTable3D,this));
   m_rnrExtrusion.changed_.connect(boost::bind(&FWGeometryTableViewBase::refreshTable3D,this));
  
   postConst();
}
FWOverlapTableView::~FWOverlapTableView ( ) [virtual]

Definition at line 159 of file FWOverlapTableView.cc.

References FWGeometryTableViewBase::m_marker.

{
   if (m_marker) m_marker->DecDenyDestroy();
}
FWOverlapTableView::FWOverlapTableView ( const FWOverlapTableView ) [private]

Member Function Documentation

void FWOverlapTableView::cdTop ( ) [virtual]
void FWOverlapTableView::cdUp ( ) [virtual]

Reimplemented from FWGeometryTableViewBase.

Definition at line 264 of file FWOverlapTableView.cc.

References setCheckerState().

void FWOverlapTableView::chosenItem ( int  x) [virtual]

Reimplemented from FWGeometryTableViewBase.

Definition at line 287 of file FWOverlapTableView.cc.

References gather_cfg::cout, FWGeoTopNode::getFirstSelectedTableIndex(), FWGeoTopNode::kPrintOverlap, FWGeometryTableViewBase::m_eveTopNode, m_tableManager, and FWOverlapTableManager::printOverlaps().

{
   // printf(" FWOverlapTableView::chosenItem chosen item %s \n", ni->name());
   
   switch (menuIdx) {
      case FWGeoTopNode::kPrintOverlap:
      {
         std::cout << "=============================================================================" <<  std::endl << std::endl;
         m_tableManager->printOverlaps(m_eveTopNode->getFirstSelectedTableIndex());
         break;
      }
      default:
         FWGeometryTableViewBase::chosenItem(menuIdx);
   }
}
FWOverlapTableView::ClassDef ( FWOverlapTableView  ,
 
)
void FWOverlapTableView::drawPoints ( )

Definition at line 248 of file FWOverlapTableView.cc.

References m_drawPoints, FWGeometryTableViewBase::m_marker, and FWGenericParameter< T >::value().

Referenced by FWOverlapTableView().

{
   m_marker->SetRnrSelf(m_drawPoints.value());
   m_marker->ElementChanged();
   gEve->Redraw3D();
}
TEveElement * FWOverlapTableView::getEveGeoElement ( ) const [protected, virtual]

Definition at line 184 of file FWOverlapTableView.cc.

References FWGeometryTableViewBase::m_eveTopNode.

{
   return m_eveTopNode;
}
FWGeometryTableManagerBase * FWOverlapTableView::getTableManager ( ) [virtual]
bool FWOverlapTableView::listAllNodes ( ) const
const FWOverlapTableView& FWOverlapTableView::operator= ( const FWOverlapTableView ) [private]
void FWOverlapTableView::pointSize ( )

Definition at line 256 of file FWOverlapTableView.cc.

References FWGeometryTableViewBase::m_marker, m_pointSize, and FWGenericParameter< T >::value().

Referenced by FWOverlapTableView().

{
   m_marker->SetMarkerSize(m_pointSize.value());
   m_marker->ElementChanged();
   gEve->Redraw3D();
}
void FWOverlapTableView::populateController ( ViewerParameterGUI gui) const [virtual]

Reimplemented from FWGeometryTableViewBase.

Definition at line 232 of file FWOverlapTableView.cc.

References m_extrusionMarkerColor, m_overlapMarkerColor, m_pointSize, m_rnrExtrusion, m_rnrOverlap, and ViewerParameterGUI::requestTab().

{
   gui.requestTab("Style").
      // addParam(&m_enableHighlight).
      // separator().
      addParam(&m_rnrOverlap).
      addParam(&m_rnrExtrusion).
      separator().
      addParam(&m_extrusionMarkerColor).
     addParam(&m_overlapMarkerColor).
      addParam(&m_pointSize);
   
   FWGeometryTableViewBase::populateController(gui);
}
void FWOverlapTableView::precisionCallback ( Long_t  )

Definition at line 190 of file FWOverlapTableView.cc.

References gather_cfg::cout, m_numEntry, m_precision, FWGenericParameter< T >::set(), setCheckerState(), and sUpdateMsg.

{
   // std::cout << " ----------------------------- PRECISION \n" <<  m_numEntry->GetNumber();
   setCheckerState(true);
   m_precision.set( m_numEntry->GetNumber());
   std::cout << sUpdateMsg;
}
void FWOverlapTableView::recalculate ( )
void FWOverlapTableView::refreshTable3D ( ) [virtual]

Reimplemented from FWGeometryTableViewBase.

Definition at line 304 of file FWOverlapTableView.cc.

References FWGeometryTableViewBase::getTopNodeIdx(), i, FWGeometryTableManagerBase::isNodeRendered(), j, FWGeometryTableViewBase::m_enableRedraw, m_extrusionMarkerColor, FWGeometryTableViewBase::m_marker, FWOverlapTableManager::QuadId::m_nodes, m_overlapMarkerColor, FWOverlapTableManager::QuadId::m_ovl, m_rnrExtrusion, m_rnrOverlap, m_tableManager, lumiQueryAPI::q, and FWGenericParameter< T >::value().

Referenced by FWOverlapTableView(), recalculate(), and setListAllNodes().

{
   using namespace TMath;
   if (!m_enableRedraw) return;
   FWGeometryTableViewBase::refreshTable3D();

   for (int i = 0; i < m_marker->GetPlex()->Size(); ++i)
   {
      FWOverlapTableManager::QuadId* id = (FWOverlapTableManager::QuadId*) m_marker->GetId(i);
      TEveQuadSet::QFreeQuad_t* q = (TEveQuadSet::QFreeQuad_t*)m_marker->GetDigit(i);
      q->fValue = -1;

      // check if any of the overlaping nodes is visible -> is in the subtree
      bool rnr = false;
      
      for (std::vector<int>::iterator j = id->m_nodes.begin(); j < id->m_nodes.end(); ++j)
      {
         if ( (id->m_ovl->IsExtrusion() && m_rnrExtrusion.value()) ||  (id->m_ovl->IsOverlap() && m_rnrOverlap.value()))
         {
            if (*j == getTopNodeIdx() || m_tableManager->isNodeRendered(*j, getTopNodeIdx() )) {
               rnr = true;
               break;
            }
         }
      }

      if (rnr) {
         q->fValue = (id->m_ovl->IsOverlap())  ? m_overlapMarkerColor.value() : m_extrusionMarkerColor.value();
         q->fValue += 1000;
      }
   }

   m_marker->ElementChanged();
   gEve->FullRedraw3D(false, true);
}
void FWOverlapTableView::setCheckerState ( bool  x) [private]

Definition at line 278 of file FWOverlapTableView.cc.

References m_applyButton, m_runChecker, and x.

Referenced by cdTop(), cdUp(), precisionCallback(), and recalculate().

{
   m_runChecker = x;
   m_applyButton->SetForegroundColor(x ? 0xff0000 : 0x000000);
   gClient->NeedRedraw(m_applyButton);

}
void FWOverlapTableView::setFrom ( const FWConfiguration iFrom) [virtual]
void FWOverlapTableView::setListAllNodes ( )

Member Data Documentation

TGTextButton* FWOverlapTableView::m_applyButton [private]

Definition at line 69 of file FWOverlapTableView.h.

Referenced by FWOverlapTableView(), and setCheckerState().

Definition at line 91 of file FWOverlapTableView.h.

Referenced by drawPoints(), and FWOverlapTableView().

Definition at line 93 of file FWOverlapTableView.h.

Referenced by FWOverlapTableView(), populateController(), and refreshTable3D().

Definition at line 86 of file FWOverlapTableView.h.

Referenced by FWOverlapTableView(), listAllNodes(), and setListAllNodes().

TGCheckButton* FWOverlapTableView::m_listOptionButton [private]

Definition at line 70 of file FWOverlapTableView.h.

Referenced by FWOverlapTableView(), and setListAllNodes().

Definition at line 76 of file FWOverlapTableView.h.

Referenced by FWOverlapTableView(), precisionCallback(), and setFrom().

Definition at line 94 of file FWOverlapTableView.h.

Referenced by FWOverlapTableView(), populateController(), and refreshTable3D().

Definition at line 83 of file FWOverlapTableView.h.

Referenced by recalculate().

Definition at line 92 of file FWOverlapTableView.h.

Referenced by FWOverlapTableView(), pointSize(), and populateController().

Definition at line 84 of file FWOverlapTableView.h.

Referenced by FWOverlapTableView(), precisionCallback(), recalculate(), and setFrom().

Definition at line 78 of file FWOverlapTableView.h.

Referenced by setCheckerState().