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 <unordered_map>
24 
27 
28 #include "TGeoVolume.h"
29 
31 public:
33 
34  enum GeometryBits { kMatches = BIT(5), kChildMatches = BIT(6), kFilterCached = BIT(7) };
35 
36  struct Match {
37  bool m_matches;
40 
41  bool accepted() const { return m_matches || m_childMatches; }
42  };
43 
44  typedef std::unordered_map<TGeoVolume*, Match> Volumes_t;
45  typedef Volumes_t::iterator Volumes_i;
46 
48  ~FWGeometryTableManager() override;
49 
50  void recalculateVisibility() override;
53  // geo
54  void loadGeometry(TGeoNode* iGeoTopNode, TObjArray* iVolumes);
55  void checkChildMatches(TGeoVolume* v, std::vector<TGeoVolume*>&);
56  void importChildren(int parent_idx);
57  void checkHierarchy();
58 
59  // signal callbacks
60  void updateFilter(int);
61  void printMaterials();
62 
63  void setDaughtersSelfVisibility(int i, bool v) override;
64  void setVisibility(NodeInfo& nodeInfo, bool) override;
65  void setVisibilityChld(NodeInfo& nodeInfo, bool) override;
66 
67  bool getVisibilityChld(const NodeInfo& nodeInfo) const override;
68  bool getVisibility(const NodeInfo& nodeInfo) const override;
69 
71 
72  int numberOfColumns() const override { return kNumColumn; }
73  FWTableCellRendererBase* cellRenderer(int iSortedRowNumber, int iCol) const override;
74 
75  void checkRegionOfInterest(double* center, double radius, long algo);
76  void resetRegionOfInterest();
77 
78 protected:
79  bool nodeIsParent(const NodeInfo&) const override;
80  // virtual FWGeometryTableManagerBase::ESelectionState nodeSelectionState(int) const;
81  const char* cellName(const NodeInfo& data) const override;
82 
83 public:
84  FWGeometryTableManager(const FWGeometryTableManager&) = delete; // stop default
85  const FWGeometryTableManager& operator=(const FWGeometryTableManager&) = delete; // stop default
86 
87 private:
89 
91 
92  bool m_filterOff; //cached
93 };
94 
95 #endif
FWGeometryTableView * m_browser
FWGeometryTableManager(FWGeometryTableView *)
void checkRegionOfInterest(double *center, double radius, long algo)
std::unordered_map< TGeoVolume *, Match > Volumes_t
void setDaughtersSelfVisibility(int i, bool v) override
const FWGeometryTableManager & operator=(const FWGeometryTableManager &)=delete
void assertNodeFilterCache(NodeInfo &data)
bool getVisibility(const NodeInfo &nodeInfo) const override
const char * cellName(const NodeInfo &data) const override
void checkChildMatches(TGeoVolume *v, std::vector< TGeoVolume *> &)
bool nodeIsParent(const NodeInfo &) const override
void loadGeometry(TGeoNode *iGeoTopNode, TObjArray *iVolumes)
FWTableCellRendererBase * cellRenderer(int iSortedRowNumber, int iCol) const override
void setVisibility(NodeInfo &nodeInfo, bool) override
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int numberOfColumns() const override
Number of columns in the table.
Volumes_t::iterator Volumes_i
void importChildren(int parent_idx)
bool getVisibilityChld(const NodeInfo &nodeInfo) const override
void setVisibilityChld(NodeInfo &nodeInfo, bool) override