Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
AssociatedObjectHandleBase.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 
7 // //
8 // Header file for class AssociatedObjectHandleBase //
9 // //
10 // Description: Handle for objects associated with tracks, //
11 // such as measurements, surfaces, etc. //
12 // It might provide just one object, or it //
13 // might alternatively be split into multiple //
14 // components (parts) //
15 // //
16 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
17 // Initial version: March 2008 //
18 // //
20 
21 #ifndef ASSOCIATEDOBJECTHANDLEBASE_H
22 #define ASSOCIATEDOBJECTHANDLEBASE_H
23 
24 
25 
26 #include <QStringList>
28 
29 class TrackHandleBase;
30 class SoTransform;
31 class SoNode;
32 class SoSeparator;
33 class TrackSysCommonData;
36 public:
37 
38  static int numberOfInstances();
39 
40  AssociatedObjectHandleBase(TrackHandleBase*);//The handle will register itself
41  //with the trackhandle, which will
42  //also take care of deleting it
43  //before moving to next event.
44  virtual QStringList clicked() = 0;
45  // virtual SoNode * getNodeForPart( int part ) const = 0;
46  virtual TrackCommonFlags::TSOSPartsFlags parts() const { return TrackCommonFlags::TSOSPartsFlags(); }
47  virtual unsigned nParts() const { return 1; }
50  bool hasError() const { return parts() & TrackCommonFlags::TSOS_AnyErrors; }
52  bool hasSurface() const { return parts() & TrackCommonFlags::TSOS_AnySurface; }
54 
55  TrackSysCommonData * common() const;
56 
58  void setPickable(PICKSTYLE);
59  PICKSTYLE pickStyle() const { return m_pickStyle; }
60  virtual void setVisible(bool);
61  bool visible() const { return m_visible; }
63 
65  void update3DObjects();//Call when settings changed affecting the shapes.
66 
67  //Return current shapes (0 if not built at the moment):
68  SoSeparator* shapeSimple() const;
69  SoSeparator* shapeDetailed() const;
70 
71  virtual bool initiatesOwnZooms() const { return false; }
72 
73 protected:
74 
75  virtual void buildShapes(SoSeparator*&shape_simple, SoSeparator*&shape_detailed) = 0;
76  //The returned SoSeparators should return all necessary transforms,
77  //and must optionally also include any necessary SoMaterial nodes
78  //(otherwise everything will get the track colour).
79 
80  //The next two are for LevelOfDetail. Probably return per detector type/station id?
81  virtual int regionIndex() const { return 0; };
82  virtual double lodCrossOverValue() const { return 50*50; };
83 
84 private:
85 
86  // It is illegal to copy/assign an AssociatedObjectHandleBase:
89 
90  class Imp;
91  Imp * m_d;
92 
94  bool m_visible;
96  void registerShapes(SoSeparator*simple,SoSeparator*detailed);
97  void unregisterShapes(SoSeparator*simple,SoSeparator*detailed);
99 
100 protected:
101  friend class TrackHandleBase;
102  virtual ~AssociatedObjectHandleBase();//The TrackHandleBase will delete it.
103 
104 };
105 
106 #endif
AssociatedObjectHandleBase::nParts
virtual unsigned nParts() const
Definition: AssociatedObjectHandleBase.h:47
AssociatedObjectHandleBase::hasError
bool hasError() const
Definition: AssociatedObjectHandleBase.h:50
AssociatedObjectHandleBase::m_d
Imp * m_d
Definition: AssociatedObjectHandleBase.h:90
AssociatedObjectHandleBase::UNPICKABLE
@ UNPICKABLE
Definition: AssociatedObjectHandleBase.h:57
AssociatedObjectHandleBase
Definition: AssociatedObjectHandleBase.h:35
AssociatedObjectHandleBase::parts
virtual TrackCommonFlags::TSOSPartsFlags parts() const
Definition: AssociatedObjectHandleBase.h:46
AssociatedObjectHandleBase::hasParameters
bool hasParameters() const
Definition: AssociatedObjectHandleBase.h:48
AssociatedObjectHandleBase::lodCrossOverValue
virtual double lodCrossOverValue() const
Definition: AssociatedObjectHandleBase.h:82
AssociatedObjectHandleBase::Imp
Definition: AssociatedObjectHandleBase.cxx:27
AssociatedObjectHandleBase::regionIndex
virtual int regionIndex() const
Definition: AssociatedObjectHandleBase.h:81
AssociatedObjectHandleBase::AssociatedObjectHandleBase
AssociatedObjectHandleBase(const AssociatedObjectHandleBase &)
AssociatedObjectHandleBase::visible
bool visible() const
Definition: AssociatedObjectHandleBase.h:61
TrackCommonFlags.h
AssociatedObjectHandleBase::m_trackHandle
TrackHandleBase * m_trackHandle
Definition: AssociatedObjectHandleBase.h:93
TrackCommonFlags::TSOS_AnyMeasurement
@ TSOS_AnyMeasurement
Definition: TrackCommonFlags.h:61
AssociatedObjectHandleBase::hasParError
bool hasParError() const
Definition: AssociatedObjectHandleBase.h:49
AssociatedObjectHandleBase::hasSurface
bool hasSurface() const
Definition: AssociatedObjectHandleBase.h:52
AssociatedObjectHandleBase::COMPONENTS
@ COMPONENTS
Definition: AssociatedObjectHandleBase.h:57
AssociatedObjectHandleBase::update3DObjects
void update3DObjects()
Definition: AssociatedObjectHandleBase.cxx:185
AssociatedObjectHandleBase::toggleVisible
void toggleVisible()
Definition: AssociatedObjectHandleBase.h:62
TrackCommonFlags::TSOS_AnySurface
@ TSOS_AnySurface
Definition: TrackCommonFlags.h:60
AssociatedObjectHandleBase::hasMaterialEffect
bool hasMaterialEffect() const
Definition: AssociatedObjectHandleBase.h:51
AssociatedObjectHandleBase::trackHandle
TrackHandleBase * trackHandle() const
Definition: AssociatedObjectHandleBase.h:64
TrackCommonFlags::TSOS_AnyErrors
@ TSOS_AnyErrors
Definition: TrackCommonFlags.h:67
AssociatedObjectHandleBase::initiatesOwnZooms
virtual bool initiatesOwnZooms() const
Definition: AssociatedObjectHandleBase.h:71
AssociatedObjectHandleBase::~AssociatedObjectHandleBase
virtual ~AssociatedObjectHandleBase()
Definition: AssociatedObjectHandleBase.cxx:118
AssociatedObjectHandleBase::getAttachmentHandle
AssocObjAttachmentHandle * getAttachmentHandle()
Definition: AssociatedObjectHandleBase.cxx:155
AssociatedObjectHandleBase::setPickable
void setPickable(PICKSTYLE)
Definition: AssociatedObjectHandleBase.cxx:136
TrackCommonFlags::TSOS_TrackPars
@ TSOS_TrackPars
bit 0
Definition: TrackCommonFlags.h:44
AssociatedObjectHandleBase::pickStyle
PICKSTYLE pickStyle() const
Definition: AssociatedObjectHandleBase.h:59
AssociatedObjectHandleBase::m_visible
bool m_visible
Definition: AssociatedObjectHandleBase.h:94
TrackSysCommonData
Definition: TrackSysCommonData.h:50
AssociatedObjectHandleBase::common
TrackSysCommonData * common() const
Definition: AssociatedObjectHandleBase.cxx:105
AssociatedObjectHandleBase::m_pickStyle
PICKSTYLE m_pickStyle
Definition: AssociatedObjectHandleBase.h:95
AssocObjAttachmentHandle
Definition: TrackHandleBase.h:202
AssociatedObjectHandleBase::PICKSTYLE
PICKSTYLE
Definition: AssociatedObjectHandleBase.h:57
AssociatedObjectHandleBase::buildShapes
virtual void buildShapes(SoSeparator *&shape_simple, SoSeparator *&shape_detailed)=0
AssociatedObjectHandleBase::unregisterShapes
void unregisterShapes(SoSeparator *simple, SoSeparator *detailed)
Definition: AssociatedObjectHandleBase.cxx:99
AssociatedObjectHandleBase::numberOfInstances
static int numberOfInstances()
Definition: AssociatedObjectHandleBase.cxx:130
AssociatedObjectHandleBase::setVisible
virtual void setVisible(bool)
Definition: AssociatedObjectHandleBase.cxx:171
TrackCommonFlags::TSOS_AnyMaterialEffects
@ TSOS_AnyMaterialEffects
Definition: TrackCommonFlags.h:59
AssociatedObjectHandleBase::operator=
AssociatedObjectHandleBase & operator=(const AssociatedObjectHandleBase &)
AssociatedObjectHandleBase::ALL
@ ALL
Definition: AssociatedObjectHandleBase.h:57
AssociatedObjectHandleBase::hasMeasurement
bool hasMeasurement() const
Definition: AssociatedObjectHandleBase.h:53
TrackCommonFlags::TSOS_AnyParsErrors
@ TSOS_AnyParsErrors
Definition: TrackCommonFlags.h:66
AssociatedObjectHandleBase::shapeSimple
SoSeparator * shapeSimple() const
Definition: AssociatedObjectHandleBase.cxx:200
AssociatedObjectHandleBase::shapeDetailed
SoSeparator * shapeDetailed() const
Definition: AssociatedObjectHandleBase.cxx:206
AssociatedObjectHandleBase::clicked
virtual QStringList clicked()=0
TrackHandleBase
Definition: TrackHandleBase.h:56
AssociatedObjectHandleBase::AssociatedObjectHandleBase
AssociatedObjectHandleBase(TrackHandleBase *)
Definition: AssociatedObjectHandleBase.cxx:111
AssociatedObjectHandleBase::registerShapes
void registerShapes(SoSeparator *simple, SoSeparator *detailed)
Definition: AssociatedObjectHandleBase.cxx:93