CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions
FWGeoTopNodeGLScene Class Reference

#include <FWGeoTopNodeScene.h>

Inheritance diagram for FWGeoTopNodeGLScene:

Public Member Functions

Int_t AddObject (const TBuffer3D &buffer, Bool_t *addChildren=nullptr) override
 
virtual Bool_t DestroyPhysical (Int_t)
 
Int_t DestroyPhysicals () override
 
 FWGeoTopNodeGLScene (TVirtualPad *pad)
 
void GeoPopupMenu (Int_t gx, Int_t gy, TGLViewer *)
 
bool OpenCompositeWithPhyID (UInt_t phyID, const TBuffer3D &buffer)
 
Bool_t ResolveSelectRecord (TGLSelectRecord &rec, Int_t curIdx) override
 
void SetPad (TVirtualPad *p)
 
 ~FWGeoTopNodeGLScene () override
 

Public Attributes

FWGeoTopNodem_eveTopNode
 

Private Member Functions

 FWGeoTopNodeGLScene (const FWGeoTopNodeGLScene &)=delete
 
FWGeoTopNodeGLSceneoperator= (const FWGeoTopNodeGLScene &)=delete
 

Detailed Description

Definition at line 9 of file FWGeoTopNodeScene.h.

Constructor & Destructor Documentation

FWGeoTopNodeGLScene::FWGeoTopNodeGLScene ( const FWGeoTopNodeGLScene )
privatedelete
FWGeoTopNodeGLScene::FWGeoTopNodeGLScene ( TVirtualPad *  pad)

Definition at line 14 of file FWGeoTopNodeScene.cc.

14  :
15  TGLScenePad(pad),
16  // fNextCompositeID(0),
17  m_eveTopNode(nullptr)
18 {
19  // Constructor.
20  // fInternalPIDs = false;
21  fTitle="GeoTopNodeScene";
22 }
FWGeoTopNode * m_eveTopNode
FWGeoTopNodeGLScene::~FWGeoTopNodeGLScene ( )
inlineoverride

Definition at line 21 of file FWGeoTopNodeScene.h.

21 {}

Member Function Documentation

Int_t FWGeoTopNodeGLScene::AddObject ( const TBuffer3D &  buffer,
Bool_t *  addChildren = nullptr 
)
override

Definition at line 51 of file FWGeoTopNodeScene.cc.

References fwLog, and fwlog::kError.

Referenced by SetPad().

52 {
53  if (fComposite)
54  {
55  // TGeoSubstraction, TGeoUnion, ... phyID ignored in this case
56  int ns = TGLScenePad::AddObject(1, buffer, addChildren);
57  return ns;
58  }
59  else
60  {
61  fwLog(fwlog::kError)<< "FWGeoTopNodeGLScene::AddObject() should not be called if fNextCompositeID \n";
62  return TGLScenePad::AddObject(buffer, addChildren);
63  }
64 }
#define fwLog(_level_)
Definition: fwLog.h:50
Bool_t FWGeoTopNodeGLScene::DestroyPhysical ( Int_t  x)
virtual

Definition at line 117 of file FWGeoTopNodeScene.cc.

References fwLog, and fwlog::kInfo.

Referenced by SetPad().

118 {
119  fwLog(fwlog::kInfo) << "FWGeoTopNodeGLScene::DestroyPhysical()\n";
120  return TGLScene::DestroyPhysical(x);
121 }
#define fwLog(_level_)
Definition: fwLog.h:50
Int_t FWGeoTopNodeGLScene::DestroyPhysicals ( )
override

Definition at line 101 of file FWGeoTopNodeScene.cc.

References m_eveTopNode.

Referenced by SetPad().

102 {
103  // Need to clear state on full redraw, else FWGeoTopNode ends
104  // with invalid set of selected physical and logical ids.
105 
106  if (gEve->GetSelection()->HasChild( m_eveTopNode))
107  gEve->GetSelection()->RemoveElement( m_eveTopNode);
108 
109  if (gEve->GetHighlight()->HasChild( m_eveTopNode))
110  gEve->GetHighlight()->RemoveElement( m_eveTopNode);
111 
112 
113  return TGLScene::DestroyPhysicals();
114 }
FWGeoTopNode * m_eveTopNode
void FWGeoTopNodeGLScene::GeoPopupMenu ( Int_t  gx,
Int_t  gy,
TGLViewer *  v 
)

Definition at line 124 of file FWGeoTopNodeScene.cc.

References m_eveTopNode, gen::n, FWGeoTopNode::popupMenu(), SetPad(), and protons_cff::t.

Referenced by FWGLEventHandler::PopupContextMenu(), and SetPad().

125 {
126  m_eveTopNode->popupMenu(gx, gy,v);
127 }
FWGeoTopNode * m_eveTopNode
virtual void popupMenu(int x, int y, TGLViewer *)
Definition: FWGeoTopNode.h:81
Bool_t FWGeoTopNodeGLScene::OpenCompositeWithPhyID ( UInt_t  phyID,
const TBuffer3D &  buffer 
)

Definition at line 25 of file FWGeoTopNodeScene.cc.

References WDecay::kNone.

Referenced by FWGeoTopNode::paintShape(), and SetPad().

26 {
27  // Open new composite container.
28  // TVirtualViewer3D interface overload - see base/src/TVirtualViewer3D.cxx
29  // for description of viewer architecture.
30 
31  if (fComposite) {
32  Error("FWGeoTopNodeGLScene::OpenComposite", "composite already open");
33  return kFALSE;
34  }
35 
36  UInt_t extraSections = TGLScenePad::AddObject(phyID, buffer, nullptr);
37  if (extraSections != TBuffer3D::kNone) {
38  Error("FWGeoTopNodeGLScene::OpenComposite", "expected top level composite to not require extra buffer sections");
39  }
40 
41  // If composite was created it is of interest - we want the rest of the
42  // child components
43  if (fComposite) {
44  return kTRUE;
45  } else {
46  return kFALSE;
47  }
48 }
edm::ErrorSummaryEntry Error
FWGeoTopNodeGLScene& FWGeoTopNodeGLScene::operator= ( const FWGeoTopNodeGLScene )
privatedelete
Bool_t FWGeoTopNodeGLScene::ResolveSelectRecord ( TGLSelectRecord &  rec,
Int_t  curIdx 
)
override

Definition at line 67 of file FWGeoTopNodeScene.cc.

References m_eveTopNode.

Referenced by SetPad().

68 {
69  // Process selection record rec.
70  // 'curIdx' is the item position where the scene should start
71  // its processing.
72  // Return TRUE if an object has been identified or FALSE otherwise.
73  // The scene-info member of the record is already set by the caller.
74 
75  if (curIdx >= rec.GetN())
76  return kFALSE;
77 
78  TGLPhysicalShape* pshp = FindPhysical(rec.GetItem(curIdx));
79 
80  /*
81  printf("FWGeoTopNodeGLScene::ResolveSelectRecord pshp=%p, lshp=%p, obj=%p, shpcls=%s\n",
82  (void*)pshp,(void*) pshp->GetLogical(),(void*) pshp->GetLogical()->GetExternal(),
83  ((TGeoVolume*)pshp->GetLogical()->GetExternal())->GetShape()->ClassName());
84  */
85  if (pshp)
86  {
87  rec.SetTransparent(pshp->IsTransparent());
88  rec.SetPhysShape(pshp);
89 
90 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,32,0)
91  rec.SetLogShape(FindLogical(m_eveTopNode));
92 #endif
93  rec.SetObject(m_eveTopNode);
94  rec.SetSpecific(nullptr);
95  return kTRUE;
96  }
97  return kFALSE;
98 }
FWGeoTopNode * m_eveTopNode
void FWGeoTopNodeGLScene::SetPad ( TVirtualPad *  p)
inline

Member Data Documentation

FWGeoTopNode* FWGeoTopNodeGLScene::m_eveTopNode