Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:54

0001 #ifndef DDCore_DDFilteredView_h
0002 #define DDCore_DDFilteredView_h
0003 
0004 #include <utility>
0005 #include <vector>
0006 
0007 #include "DetectorDescription/Core/interface/DDRotationMatrix.h"
0008 #include "DetectorDescription/Core/interface/DDTranslation.h"
0009 #include "DetectorDescription/Core/interface/DDExpandedNode.h"
0010 #include "DetectorDescription/Core/interface/DDExpandedView.h"
0011 #include "DetectorDescription/Core/interface/DDFilter.h"
0012 #include "DetectorDescription/Core/interface/DDSolid.h"
0013 #include "DetectorDescription/Core/interface/DDsvalues.h"
0014 #include "DetectorDescription/Core/interface/DDMaterial.h"
0015 
0016 class DDCompactView;
0017 class DDLogicalPart;
0018 class DDScope;
0019 
0020 class DDFilteredView {
0021 public:
0022   typedef DDExpandedView::nav_type nav_type;
0023 
0024   //!Keeps a pointer to the DDfilter
0025   DDFilteredView(const DDCompactView &, const DDFilter &);
0026 
0027   DDFilteredView() = delete;
0028 
0029   //! The logical-part of the current node in the filtered-view
0030   const DDLogicalPart &logicalPart() const;
0031 
0032   //! The name of a logical-part of the current node in the filtered-view
0033   const std::string &name() const;
0034   const DDSolidShape shape() const;
0035   std::string const material() const;
0036   const std::vector<double> &parameters() const;
0037 
0038   //! The absolute translation of the current node
0039   const DDTranslation &translation() const;
0040 
0041   //! The absolute rotation of the current node
0042   const DDRotationMatrix &rotation() const;
0043 
0044   //! The list of ancestors up to the root-node of the current node
0045   const DDGeoHistory &geoHistory() const;
0046 
0047   //! return the stack of sibling numbers
0048   nav_type navPos() const;
0049   bool goTo(const nav_type &);
0050 
0051   //! return the stack of copy numbers
0052   nav_type copyNumbers() const;
0053 
0054   //! User specific data attached to the current node
0055   void specificsV(std::vector<const DDsvalues_type *> &result) const;
0056   std::vector<const DDsvalues_type *> specifics() const;
0057   void mergedSpecificsV(DDsvalues_type &merged) const;
0058   DDsvalues_type mergedSpecifics() const;
0059 
0060   //! The DDVector information
0061   std::vector<double> const &vector(std::string_view iKey) const { return epv_.vector(iKey); }
0062 
0063   //! Copy number associated with the current node
0064   int copyno() const;
0065 
0066   // navigation
0067 
0068   //! The scope of the expanded-view.
0069   const DDGeoHistory &scope() const;
0070 
0071   //! sets the scope of the expanded view
0072   bool setScope(const DDGeoHistory &hist);
0073 
0074   //! clears the scope; the full tree is available, depth=0
0075   void clearScope();
0076 
0077   //! set current node to the next node in the filtered tree
0078   bool next();
0079 
0080   //! set the current node to the next sibling ...
0081   bool nextSibling();
0082 
0083   //! set the current node to the first child ...
0084   bool firstChild();
0085 
0086   //! set the current node to the parent node ...
0087   bool parent();
0088 
0089   //! clears the scope and sets the filtered view to its root-node
0090   void reset();
0091 
0092   void print();
0093 
0094   const std::vector<DDGeoHistory> &history() const;
0095 
0096 private:
0097   bool filter();
0098 
0099   DDExpandedView epv_;
0100   DDFilter const *filter_;
0101   std::vector<DDGeoHistory> parents_;  // filtered-parents
0102 };
0103 
0104 #endif