ATLAS Offline Software
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 class TrackHandleBase;
26 class SoTransform;
27 class SoNode;
28 class SoSeparator;
29 class TrackSysCommonData;
31 #include <QStringList>
32 
34 public:
35 
36  static int numberOfInstances();
37 
38  AssociatedObjectHandleBase(TrackHandleBase*);//The handle will register itself
39  //with the trackhandle, which will
40  //also take care of deleting it
41  //before moving to next event.
42  virtual QStringList clicked() = 0;
43  // virtual SoNode * getNodeForPart( int part ) const = 0;
44  virtual unsigned nParts() const { return 1; }
45 
46  TrackSysCommonData * common() const;
47 
49  void setPickable(PICKSTYLE);
50  PICKSTYLE pickStyle() const { return m_pickStyle; }
51  virtual void setVisible(bool);
52  bool visible() const { return m_visible; }
54 
56  void update3DObjects();//Call when settings changed affecting the shapes.
57 
58  //Return current shapes (0 if not built at the moment):
59  SoSeparator* shapeSimple() const;
60  SoSeparator* shapeDetailed() const;
61 
62  virtual bool initiatesOwnZooms() const { return false; }
63 
64 protected:
65 
66  virtual void buildShapes(SoSeparator*&shape_simple, SoSeparator*&shape_detailed) = 0;
67  //The returned SoSeparators should return all necessary transforms,
68  //and must optionally also include any necessary SoMaterial nodes
69  //(otherwise everything will get the track colour).
70 
71  //The next two are for LevelOfDetail. Probably return per detector type/station id?
72  virtual int regionIndex() const { return 0; };
73  virtual double lodCrossOverValue() const { return 50*50; };
74 
75 private:
76 
77  // It is illegal to copy/assign an AssociatedObjectHandleBase:
80 
81  class Imp;
82  Imp * m_d;
83 
85  bool m_visible;
87  void registerShapes(SoSeparator*simple,SoSeparator*detailed);
88  void unregisterShapes(SoSeparator*simple,SoSeparator*detailed);
90 
91 protected:
92  friend class TrackHandleBase;
93  virtual ~AssociatedObjectHandleBase();//The TrackHandleBase will delete it.
94 
95 };
96 
97 #endif
AssociatedObjectHandleBase::nParts
virtual unsigned nParts() const
Definition: AssociatedObjectHandleBase.h:44
AssociatedObjectHandleBase::m_d
Imp * m_d
Definition: AssociatedObjectHandleBase.h:81
AssociatedObjectHandleBase::UNPICKABLE
@ UNPICKABLE
Definition: AssociatedObjectHandleBase.h:48
AssociatedObjectHandleBase
Definition: AssociatedObjectHandleBase.h:33
AssociatedObjectHandleBase::lodCrossOverValue
virtual double lodCrossOverValue() const
Definition: AssociatedObjectHandleBase.h:73
AssociatedObjectHandleBase::Imp
Definition: AssociatedObjectHandleBase.cxx:27
AssociatedObjectHandleBase::regionIndex
virtual int regionIndex() const
Definition: AssociatedObjectHandleBase.h:72
AssociatedObjectHandleBase::AssociatedObjectHandleBase
AssociatedObjectHandleBase(const AssociatedObjectHandleBase &)
AssociatedObjectHandleBase::visible
bool visible() const
Definition: AssociatedObjectHandleBase.h:52
AssociatedObjectHandleBase::m_trackHandle
TrackHandleBase * m_trackHandle
Definition: AssociatedObjectHandleBase.h:84
AssociatedObjectHandleBase::COMPONENTS
@ COMPONENTS
Definition: AssociatedObjectHandleBase.h:48
AssociatedObjectHandleBase::update3DObjects
void update3DObjects()
Definition: AssociatedObjectHandleBase.cxx:185
AssociatedObjectHandleBase::toggleVisible
void toggleVisible()
Definition: AssociatedObjectHandleBase.h:53
AssociatedObjectHandleBase::trackHandle
TrackHandleBase * trackHandle() const
Definition: AssociatedObjectHandleBase.h:55
AssociatedObjectHandleBase::initiatesOwnZooms
virtual bool initiatesOwnZooms() const
Definition: AssociatedObjectHandleBase.h:62
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
AssociatedObjectHandleBase::pickStyle
PICKSTYLE pickStyle() const
Definition: AssociatedObjectHandleBase.h:50
AssociatedObjectHandleBase::m_visible
bool m_visible
Definition: AssociatedObjectHandleBase.h:85
TrackSysCommonData
Definition: TrackSysCommonData.h:47
AssociatedObjectHandleBase::common
TrackSysCommonData * common() const
Definition: AssociatedObjectHandleBase.cxx:105
AssociatedObjectHandleBase::m_pickStyle
PICKSTYLE m_pickStyle
Definition: AssociatedObjectHandleBase.h:86
AssocObjAttachmentHandle
Definition: TrackHandleBase.h:197
AssociatedObjectHandleBase::PICKSTYLE
PICKSTYLE
Definition: AssociatedObjectHandleBase.h:48
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
AssociatedObjectHandleBase::operator=
AssociatedObjectHandleBase & operator=(const AssociatedObjectHandleBase &)
AssociatedObjectHandleBase::ALL
@ ALL
Definition: AssociatedObjectHandleBase.h:48
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