ATLAS Offline Software
PRDHandleBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PRDHANDLEBASE_H
6 #define PRDHANDLEBASE_H
7 
8 //Fixme: check and doublecheck how to reduce memory used per prd (also includes maps in collhandle).
9 
11 
12 // GeoModel
14 //
15 #include "GeoModelKernel/GeoVPhysVol.h"
16 
17 #include <QFlags>
18 #include <QStringList>
19 
20 
21 
22 
23 class PRDCollHandleBase;
24 class SoMaterial;
25 class SoNode;
26 class SoTransform;
27 class SoSeparator;
28 
29 namespace Trk {
30  class PrepRawData;
31 }
32 
33 class TracksAndSegments;
34 
36 public:
37 
39  virtual ~PRDHandleBase();
40 
41  void setVisible(bool);//use by the collection handle.
42  bool visible() const { return m_visible; }
43  virtual void buildShapes(SoNode*&shape_simple, SoNode*&shape_detailed) = 0;
44  virtual int regionIndex() { return 0; }//prds near each other should return same index (used for optimal LOD usage in AUTO detail mode) (only called once/event)
45  virtual bool highLight() const { return false; }//Return true to get hit highlighted (for e.g. a TRT hits with HT).
46  //Outlier highlighting overrides this and is handled in the base classes.
47  virtual bool transformUsesSurfacePositionOnly() const { return false; }//Override and return true if should use just the surface position.
48 
49  //Return current shapes (0 if not built at the moment):
50  SoSeparator* sepSimple() const;
51  SoSeparator* sepDetailed() const;
52 
53  PRDSysCommonData * common() const { return m_common; }
54 
55  virtual Amg::Vector3D center() const;//Default impl. returns positionPRD()
56  Amg::Vector3D positionPRD() const;// The center of the getPRD()
57  Amg::Vector3D positionSecondPRD() const;//The center of the getSecondPRD(). returns (0,0,0) if not available.
58 
59  //For PRDCollHandleBase only:
61  virtual SoTransform * createTransform() const;
62  void update3DObjects();//Call whenever some setting changes in a way which requires changes to the shape of the 3D representation of the prd.
63  void updateMaterial();
64 
65  virtual QStringList clicked() const;//Called when user selects the node. The returned strings will be displayed in the textbox.
66  //Reimplement the next two for muon prds:
67  virtual bool inMuonChamber() const { return false; }
68  virtual GeoPVConstLink parentMuonChamberPV() const { return GeoPVConstLink(); }
69 
70  PRDCollHandleBase * collHandle() const;
71 
72  virtual const Trk::PrepRawData * getPRD() const = 0;//Reimplement to allow access to prd pointer in a generic way.
73  virtual const Trk::PrepRawData * getSecondPRD() const { return 0; }//For SCT spacepoints
74 
75  virtual bool isSane() const {return true;}
76 private:
77 
78  // Illegal to copy/assign a PRDHandleBase:
81 
82  class Imp;
83  Imp * m_d;
85 // inline void registerTransform(SoTransform*);
86  bool m_visible;//Here for inlining
87 
88 };
89 
90 #endif
PRDHandleBase::setVisible
void setVisible(bool)
Definition: PRDHandleBase.cxx:234
PRDHandleBase::getTransform_CLHEP
Amg::Transform3D getTransform_CLHEP() const
Definition: PRDHandleBase.cxx:322
PRDHandleBase::operator=
PRDHandleBase & operator=(const PRDHandleBase &)
PRDHandleBase::collHandle
PRDCollHandleBase * collHandle() const
Definition: PRDHandleBase.cxx:228
PRDHandleBase::positionPRD
Amg::Vector3D positionPRD() const
Definition: PRDHandleBase.cxx:303
PRDHandleBase::PRDHandleBase
PRDHandleBase(const PRDHandleBase &)
PRDHandleBase::isSane
virtual bool isSane() const
Returns false if the PRD is not safe to draw.
Definition: PRDHandleBase.h:75
PRDSysCommonData
Definition: PRDSysCommonData.h:35
PRDHandleBase::createTransform
virtual SoTransform * createTransform() const
Definition: PRDHandleBase.cxx:371
PRDHandleBase::regionIndex
virtual int regionIndex()
Definition: PRDHandleBase.h:44
PRDSysCommonData.h
PRDHandleBase::common
PRDSysCommonData * common() const
Definition: PRDHandleBase.h:53
PRDHandleBase::m_d
Imp * m_d
Definition: PRDHandleBase.h:82
PRDHandleBase::m_visible
bool m_visible
Definition: PRDHandleBase.h:86
PRDHandleBase::clicked
virtual QStringList clicked() const
Definition: PRDHandleBase.cxx:276
GeoPrimitives.h
PRDCollHandleBase
Definition: PRDCollHandleBase.h:25
PRDHandleBase::~PRDHandleBase
virtual ~PRDHandleBase()
Definition: PRDHandleBase.cxx:79
PRDHandleBase::visible
bool visible() const
Definition: PRDHandleBase.h:42
PRDHandleBase::update3DObjects
void update3DObjects()
Definition: PRDHandleBase.cxx:257
PRDHandleBase::getSecondPRD
virtual const Trk::PrepRawData * getSecondPRD() const
Definition: PRDHandleBase.h:73
PRDHandleBase::parentMuonChamberPV
virtual GeoPVConstLink parentMuonChamberPV() const
Definition: PRDHandleBase.h:68
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
PRDHandleBase::sepSimple
SoSeparator * sepSimple() const
Definition: PRDHandleBase.cxx:54
PRDHandleBase::positionSecondPRD
Amg::Vector3D positionSecondPRD() const
Definition: PRDHandleBase.cxx:309
PRDHandleBase::transformUsesSurfacePositionOnly
virtual bool transformUsesSurfacePositionOnly() const
Definition: PRDHandleBase.h:47
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
PRDHandleBase::getPRD
virtual const Trk::PrepRawData * getPRD() const =0
PRDHandleBase::updateMaterial
void updateMaterial()
Definition: PRDHandleBase.cxx:160
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
PRDHandleBase::sepDetailed
SoSeparator * sepDetailed() const
Definition: PRDHandleBase.cxx:60
PRDHandleBase::highLight
virtual bool highLight() const
Definition: PRDHandleBase.h:45
PRDHandleBase
Definition: PRDHandleBase.h:35
PRDHandleBase::inMuonChamber
virtual bool inMuonChamber() const
Definition: PRDHandleBase.h:67
PRDHandleBase::m_common
PRDSysCommonData * m_common
Definition: PRDHandleBase.h:84
PRDHandleBase::PRDHandleBase
PRDHandleBase(PRDCollHandleBase *)
Definition: PRDHandleBase.cxx:66
PRDHandleBase::center
virtual Amg::Vector3D center() const
Definition: PRDHandleBase.cxx:316
PRDHandleBase::buildShapes
virtual void buildShapes(SoNode *&shape_simple, SoNode *&shape_detailed)=0
PRDHandleBase::Imp
Definition: PRDHandleBase.cxx:34