CMS 3D CMS Logo

FWGeoTopNodeGL.cc
Go to the documentation of this file.
3 
4 #include "TGLIncludes.h"
5 #include "TGLRnrCtx.h"
6 #include "TGLViewer.h"
7 
8 //______________________________________________________________________________
10  // Constructor.
11 }
12 
13 //______________________________________________________________________________
15  // Set bounding box.
16 
17  SetAxisAlignedBBox(((FWGeoTopNode*)fExternalObj)->AssertBBox());
18 }
19 
20 //______________________________________________________________________________
21 Bool_t FWGeoTopNodeGL::SetModel(TObject* obj, const Option_t* /*opt*/) {
22  // Set model object.
23 
24  fM = SetModelDynCast<FWGeoTopNode>(obj);
25  return kTRUE;
26 }
27 
28 //______________________________________________________________________________
29 void FWGeoTopNodeGL::DirectDraw(TGLRnrCtx& rnrCtx) const {
30  // Draw quad-set with GL.
31 
32  static const TEveException eH("TEveQuadSetGL::DirectDraw ");
33 
34  // printf("FWGeoTopNodeGL::DirectDraw\n");
35 
36  // glPushAttrib(GL_POINT_BIT);
37  // glPointSize(20);
38  // glBegin(GL_POINTS);
39  // glVertex3d(1,1,1);
40  // glEnd();
41  // glPopAttrib();
42 }
43 
44 //______________________________________________________________________________
45 void FWGeoTopNodeGL::ProcessSelection(TGLRnrCtx& rnrCtx, TGLSelectRecord& rec) {
46  // Processes secondary selection from TGLViewer.
47  // Calls DigitSelected(Int_t) in the model object with index of
48  // selected point as the argument.
49 
50  // printf("FWGeoTopNodeGL::ProcessSelection who knows what we've got ...\n");
51  // rec.Print();
52 
53  TGLViewer* v = dynamic_cast<TGLViewer*>(rnrCtx.GetViewer());
54  /*
55  if (v)
56  {
57  printf(" but we know the first selection was what we actually want!\n");
58  printf(" and this is in rnrctx.viewer.selrec\n");
59  printf(" log=%p, this=%p\n", v->GetSelRec().GetLogShape(), this);
60  }
61  */
62  TGLPhysicalShape* p = v->GetSelRec().GetPhysShape();
63 
64  if (rec.GetHighlight()) {
65  fM->ProcessSelection(rec, fM->fHted, p);
66  } else {
67  fM->ProcessSelection(rec, fM->fSted, p);
68  }
69 
70  // Also, do something in UnSelected / UnHighlighted XXXXX
71 }
std::set< TGLPhysicalShape * > fSted
Definition: FWGeoTopNode.h:72
FWGeoTopNode * fM
Definition: FWGeoTopNodeGL.h:9
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
void SetBBox() override
void ProcessSelection(TGLRnrCtx &rnrCtx, TGLSelectRecord &rec) override
void ProcessSelection(TGLSelectRecord &rec, std::set< TGLPhysicalShape *> &sset, TGLPhysicalShape *id)
Definition: FWGeoTopNode.cc:88
std::set< TGLPhysicalShape * > fHted
Definition: FWGeoTopNode.h:71
void DirectDraw(TGLRnrCtx &rnrCtx) const override