CMS 3D CMS Logo

FWGeometryTableManager.h
Go to the documentation of this file.
1 #ifndef Fireworks_Core_FWGeometryTableManager_h
2 #define Fireworks_Core_FWGeometryTableManager_h
3 // -*- C++ -*-
4 //
5 // Package: Core
6 // Class : FWGeometryTableManager
7 //
16 //
17 // Original Author:
18 // Created: Wed Jan 4 20:34:22 CET 2012
19 //
20 
22 #include <string>
23 #include <boost/tr1/unordered_map.hpp>
24 
27 
28 #include "TGeoVolume.h"
29 
30 
32 {
33 public:
35 
37  {
38  kMatches = BIT(5),
39  kChildMatches = BIT(6),
40  kFilterCached = BIT(7)
41  };
42 
43  struct Match
44  {
45  bool m_matches;
47  Match() : m_matches(false), m_childMatches(false) {}
48 
49  bool accepted() { return m_matches || m_childMatches; }
50  };
51 
52 
53  typedef boost::unordered_map<TGeoVolume*, Match> Volumes_t;
54  typedef Volumes_t::iterator Volumes_i;
55 
57  ~FWGeometryTableManager() override;
58 
59  void recalculateVisibility() override;
62  // geo
63  void loadGeometry( TGeoNode* iGeoTopNode, TObjArray* iVolumes);
64  void checkChildMatches(TGeoVolume* v, std::vector<TGeoVolume*>&);
65  void importChildren(int parent_idx);
66  void checkHierarchy();
67 
68  // signal callbacks
69  void updateFilter(int);
70  void printMaterials();
71 
72  void setDaughtersSelfVisibility(int i, bool v) override;
73  void setVisibility(NodeInfo& nodeInfo, bool ) override;
74  void setVisibilityChld(NodeInfo& nodeInfo, bool) override;
75 
76  bool getVisibilityChld(const NodeInfo& nodeInfo) const override;
77  bool getVisibility (const NodeInfo& nodeInfo) const override;
78 
80 
81  int numberOfColumns() const override { return kNumColumn; }
82  FWTableCellRendererBase* cellRenderer(int iSortedRowNumber, int iCol) const override;
83 
84  void checkRegionOfInterest(double* center, double radius, long algo);
85  void resetRegionOfInterest();
86 
87 protected:
88  bool nodeIsParent(const NodeInfo&) const override;
89  // virtual FWGeometryTableManagerBase::ESelectionState nodeSelectionState(int) const;
90  const char* cellName(const NodeInfo& data) const override;
91 
92 private:
93  FWGeometryTableManager(const FWGeometryTableManager&) = delete; // stop default
94  const FWGeometryTableManager& operator=(const FWGeometryTableManager&) = delete; // stop default
95 
96 
98 
99  mutable Volumes_t m_volumes;
100 
101  bool m_filterOff; //cached
102 };
103 
104 #endif
FWGeometryTableView * m_browser
bool getVisibility(const NodeInfo &nodeInfo) const override
FWGeometryTableManager(FWGeometryTableView *)
void checkRegionOfInterest(double *center, double radius, long algo)
const char * cellName(const NodeInfo &data) const override
void setDaughtersSelfVisibility(int i, bool v) override
FWTableCellRendererBase * cellRenderer(int iSortedRowNumber, int iCol) const override
int numberOfColumns() const override
Number of columns in the table.
const FWGeometryTableManager & operator=(const FWGeometryTableManager &)=delete
bool getVisibilityChld(const NodeInfo &nodeInfo) const override
void assertNodeFilterCache(NodeInfo &data)
void loadGeometry(TGeoNode *iGeoTopNode, TObjArray *iVolumes)
void checkChildMatches(TGeoVolume *v, std::vector< TGeoVolume * > &)
void setVisibility(NodeInfo &nodeInfo, bool) override
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Volumes_t::iterator Volumes_i
boost::unordered_map< TGeoVolume *, Match > Volumes_t
void importChildren(int parent_idx)
void setVisibilityChld(NodeInfo &nodeInfo, bool) override
bool nodeIsParent(const NodeInfo &) const override