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;
39  Match() : m_matches(false), m_childMatches(false) {}
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 private:
84  FWGeometryTableManager(const FWGeometryTableManager&) = delete; // stop default
85  const FWGeometryTableManager& operator=(const FWGeometryTableManager&) = delete; // stop default
86 
88 
89  mutable Volumes_t m_volumes;
90 
91  bool m_filterOff; //cached
92 };
93 
94 #endif
FWGeometryTableView * m_browser
bool getVisibility(const NodeInfo &nodeInfo) const override
FWGeometryTableManager(FWGeometryTableView *)
void checkRegionOfInterest(double *center, double radius, long algo)
std::unordered_map< TGeoVolume *, Match > Volumes_t
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:79
Volumes_t::iterator Volumes_i
void importChildren(int parent_idx)
void setVisibilityChld(NodeInfo &nodeInfo, bool) override
bool nodeIsParent(const NodeInfo &) const override