CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDQuery.h
Go to the documentation of this file.
1 #ifndef DDCore_DDQuery_h
2 #define DDCore_DDQuery_h
3 
7 
8 #include <map>
9 #include <vector>
10 
12 class DDQuery
13 {
14 public:
16  DDQuery(const DDCompactView &);
17 
18  virtual ~DDQuery();
19 
20  virtual const std::vector<DDExpandedNode> & exec();
21 
22  virtual void addFilter(const DDFilter &, DDLogOp op = DDLogOp::AND);
23 
24  virtual void setScope(const DDScope &);
25 
26 protected:
28  const DDScope * scope_;
29 
30  std::vector<std::pair<bool, DDFilter *> > criteria_; // one filter and the result on the current node
31  std::vector<DDLogOp> logOps_; // logical operation for merging the result of 2 filters
32  std::vector<DDExpandedNode> result_; // query result
33 };
34 
35 #endif
Base class for querying for nodes in the DDExpandedView.
Definition: DDQuery.h:12
DDLogOp
logical operations to obtain one result from two filter comparisons
Definition: DDFilter.h:15
virtual const std::vector< DDExpandedNode > & exec()
Definition: DDQuery.cc:33
virtual void addFilter(const DDFilter &, DDLogOp op=DDLogOp::AND)
Definition: DDQuery.cc:16
virtual void setScope(const DDScope &)
Definition: DDQuery.cc:27
type of data representation of DDCompactView
Definition: DDCompactView.h:76
std::vector< DDExpandedNode > result_
Definition: DDQuery.h:32
virtual ~DDQuery()
Definition: DDQuery.cc:9
const DDScope * scope_
Definition: DDQuery.h:28
DDQuery(const DDCompactView &)
sets up a query
Definition: DDQuery.cc:4
defines subtrees in the expanded-view
Definition: DDScope.h:26
DDExpandedView epv_
Definition: DDQuery.h:27
A Filter accepts or rejects a DDExpandedNode based on a user-coded decision rule. ...
Definition: DDFilter.h:18
std::vector< std::pair< bool, DDFilter * > > criteria_
Definition: DDQuery.h:30
Provides an exploded view of the detector (tree-view)
std::vector< DDLogOp > logOps_
Definition: DDQuery.h:31