GeoModel - GeoModelCore
GeoVPhysVol.h
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELKERNEL_GEOVPHYSVOL_H
6 #define GEOMODELKERNEL_GEOVPHYSVOL_H
7 
8 #include "GeoModelKernel/GeoPVLink.h"
9 #define SMARTLINKS
10 #ifdef SMARTLINKS
11 typedef GeoPVLink PVLink;
13 #else
14 class GeoVPhysVol;
15 typedef GeoVPhysVol *PVLink;
16 typedef const GeoVPhysVol *PVConstLink;
17 #endif
18 #include "GeoModelKernel/GeoDefinitions.h"
19 #include "GeoModelKernel/Query.h"
20 #include <string>
21 
22 #include "GeoModelKernel/GeoLogVol.h"
23 #include "GeoModelKernel/GeoGraphNode.h"
24 
25 class GeoVolumeAction;
26 class GeoVAlignmentStore;
27 
28 class GeoVPhysVol : public GeoGraphNode
29 {
30  public:
31  GeoVPhysVol(const GeoLogVol* LogVol);
32 
33  GeoVPhysVol(const GeoVPhysVol &right) = delete;
34  GeoVPhysVol & operator=(const GeoVPhysVol &right) = delete;
35 
38  bool isShared() const;
39 
43  Query<unsigned int> indexOf(PVConstLink daughter) const;
44 
46  PVConstLink getParent() const;
47 
49  const GeoLogVol* getLogVol() const;
50 
52  virtual unsigned int getNChildVols() const = 0;
53 
55  virtual PVConstLink getChildVol(unsigned int index) const = 0;
56 
58  virtual GeoTrf::Transform3D getXToChildVol(unsigned int index, const GeoVAlignmentStore* store=nullptr) const = 0;
59 
61  virtual GeoTrf::Transform3D getDefXToChildVol(unsigned int index, const GeoVAlignmentStore* store=nullptr) const = 0;
62 
64  virtual std::string getNameOfChildVol(unsigned int i) const = 0;
65 
69  void apply(GeoVolumeAction* action) const;
70 
75  virtual void dockTo(GeoVPhysVol* parent);
76 
78  virtual Query<int> getIdOfChildVol(unsigned int i) const = 0;
79 
81  virtual unsigned int getNChildVolAndST() const = 0;
82 
83  virtual GeoTrf::Transform3D getX (const GeoVAlignmentStore* store=nullptr) const = 0;
84  virtual GeoTrf::Transform3D getDefX (const GeoVAlignmentStore* store=nullptr) const = 0;
85  virtual unsigned int getNChildNodes() const=0;
86  virtual const GeoGraphNode * const *getChildNode (unsigned int i) const=0;
87  virtual const GeoGraphNode * const *findChildNode(const GeoGraphNode *n) const=0;
88 
89  protected:
90  virtual ~GeoVPhysVol();
91 
92  private:
97 
98  const GeoLogVol *m_logVol;
99 };
100 
101 inline bool GeoVPhysVol::isShared () const
102 {
103  return m_parentPtr == this;
104 }
105 
106 #endif
virtual GeoTrf::Transform3D getXToChildVol(unsigned int index, const GeoVAlignmentStore *store=nullptr) const =0
Returns the transform to the ith volume.
A Logical Volume, or agglomeration of shape and material. The logical volume increases the reference ...
Definition: GeoLogVol.h:20
virtual std::string getNameOfChildVol(unsigned int i) const =0
Returns the name of the child.
Abstract base class for GeoModel alignment stores The interface allows to store/retrieve transformati...
This type of action sees and traverses a simpler tree of positioned volumes. It does not descend into...
virtual PVConstLink getChildVol(unsigned int index) const =0
Returns the ith child volume.
void apply(GeoVolumeAction *action) const
Definition: GeoVPhysVol.cxx:44
virtual void dockTo(GeoVPhysVol *parent)
Definition: GeoVPhysVol.cxx:93
PVConstLink getParent() const
Gets the parent, if the parent is unique, and otherwise returns a nullptr pointer.
Definition: GeoVPhysVol.cxx:33
const GeoLogVol * getLogVol() const
Returns the logical volume.
Definition: GeoVPhysVol.cxx:39
virtual GeoTrf::Transform3D getDefXToChildVol(unsigned int index, const GeoVAlignmentStore *store=nullptr) const =0
Returns the default transform to the ith volume.
virtual Query< int > getIdOfChildVol(unsigned int i) const =0
Returns the id of the child.
virtual unsigned int getNChildVolAndST() const =0
Returns the number of child physical volumes and Serial Transformers.
Query< unsigned int > indexOf(PVConstLink daughter) const
Definition: GeoVPhysVol.cxx:24
Represents Nodes that can be assembled together to make a graph. Subclasses (for now): ...
Definition: GeoGraphNode.h:28
bool isShared() const
Definition: GeoVPhysVol.h:101
const GeoVPhysVol * m_parentPtr
Definition: GeoVPhysVol.h:96
virtual unsigned int getNChildVols() const =0
Returns the number of child physical volumes.