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
FWBoolParameter m_listAllNodes
std::vector< int > m_markerIndices
std::vector< float > m_markerVertices
TGNumberEntry * m_numEntry
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, FWGeometryTableViewBase::m_frame, m_listAllNodes, m_listOptionButton, FWGeometryTableViewBase::m_marker, m_numEntry, 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:", 1l, 0l, 10l)
{ 
   // 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 TEvePointSet();
   m_marker->SetMarkerSize(5);
   m_marker->SetMainColor(kRed);
   m_marker->IncDenyDestroy();

  
   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_rnrExtrusion.changed_.connect(boost::bind(&FWGeometryTableViewBase::refreshTable3D,this));
  
   postConst();
}
FWOverlapTableView::~FWOverlapTableView ( ) [virtual]

Definition at line 151 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 258 of file FWOverlapTableView.cc.

References setCheckerState().

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

Reimplemented from FWGeometryTableViewBase.

Definition at line 281 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 242 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 176 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 250 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 227 of file FWOverlapTableView.cc.

References m_drawPoints, 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_drawPoints).
      addParam(&m_pointSize);
   
   FWGeometryTableViewBase::populateController(gui);
}
void FWOverlapTableView::precisionCallback ( Long_t  )

Definition at line 182 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 298 of file FWOverlapTableView.cc.

References AlCaHLTBitMon_QueryRunRegistry::data, FWGeometryTableManagerBase::getNNodesTotal(), FWGeometryTableViewBase::getTopNodeIdx(), i, FWOverlapTableManager::kVisMarker, m_drawPoints, FWGeometryTableViewBase::m_enableRedraw, FWGeometryTableViewBase::m_marker, m_markerIndices, m_markerVertices, m_rnrExtrusion, m_rnrOverlap, m_tableManager, n0, FWGeometryTableManagerBase::refEntries(), FWGeometryTableManagerBase::NodeInfo::testBit(), and FWGenericParameter< T >::value().

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

{
   using namespace TMath;
   if (!m_enableRedraw) return;
   FWGeometryTableViewBase::refreshTable3D();
  
   std::vector<float> pnts;
   int cnt = 0;
  
   //   std::cout << "WOverlapTableView::refreshTable3D() "<< std::endl;
   int n0 =  getTopNodeIdx();
   int nd = 0; 
    m_tableManager->getNNodesTotal(m_tableManager->refEntries().at(n0).m_node, nd);
   int n1 = n0+nd; 
   //  printf("marker rnf %d %d \n", n0, n1);
   if (m_drawPoints.value()) {
      for (std::vector<int>::iterator i = m_markerIndices.begin(); i!=m_markerIndices.end(); i++, cnt+=3)
      {
         if (Abs(*i) >= n0 && Abs(*i) <= n1)
         {
            FWGeometryTableManagerBase::NodeInfo& data = m_tableManager->refEntries().at(Abs(*i));
            if ( data.testBit(FWOverlapTableManager::kVisMarker)  && 
                 ( (( *i > 0 ) && m_rnrOverlap.value()) ||  ((*i < 0) && m_rnrExtrusion.value()) )) 
            {
               pnts.push_back(m_markerVertices[cnt]);
               pnts.push_back(m_markerVertices[cnt+1]);
               pnts.push_back(m_markerVertices[cnt+2]);
            }
         }
      } 
   }
  
   m_marker->SetPolyMarker(int(pnts.size()/3), &pnts[0], 4);
   m_marker->ElementChanged();
   gEve->FullRedraw3D(false, true);
}
void FWOverlapTableView::setCheckerState ( bool  x) [private]

Definition at line 272 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 88 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 85 of file FWOverlapTableView.h.

Referenced by recalculate().

Definition at line 94 of file FWOverlapTableView.h.

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

Definition at line 86 of file FWOverlapTableView.h.

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

Definition at line 78 of file FWOverlapTableView.h.

Referenced by setCheckerState().