Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:39

0001 #include "Fireworks/Core/src/FWGeoTopNodeGL.h"
0002 #include "Fireworks/Core/interface/FWGeoTopNode.h"
0003 
0004 #include "TGLIncludes.h"
0005 #include "TGLRnrCtx.h"
0006 #include "TGLViewer.h"
0007 
0008 //______________________________________________________________________________
0009 FWGeoTopNodeGL::FWGeoTopNodeGL() : TGLObject() {
0010   // Constructor.
0011 }
0012 
0013 //______________________________________________________________________________
0014 void FWGeoTopNodeGL::SetBBox() {
0015   // Set bounding box.
0016 
0017   SetAxisAlignedBBox(((FWGeoTopNode*)fExternalObj)->AssertBBox());
0018 }
0019 
0020 //______________________________________________________________________________
0021 Bool_t FWGeoTopNodeGL::SetModel(TObject* obj, const Option_t* /*opt*/) {
0022   // Set model object.
0023 
0024   fM = SetModelDynCast<FWGeoTopNode>(obj);
0025   return kTRUE;
0026 }
0027 
0028 //______________________________________________________________________________
0029 void FWGeoTopNodeGL::DirectDraw(TGLRnrCtx& rnrCtx) const {
0030   // Draw quad-set with GL.
0031 
0032   static const TEveException eH("TEveQuadSetGL::DirectDraw ");
0033 
0034   // printf("FWGeoTopNodeGL::DirectDraw\n");
0035 
0036   // glPushAttrib(GL_POINT_BIT);
0037   // glPointSize(20);
0038   // glBegin(GL_POINTS);
0039   // glVertex3d(1,1,1);
0040   // glEnd();
0041   // glPopAttrib();
0042 }
0043 
0044 //______________________________________________________________________________
0045 void FWGeoTopNodeGL::ProcessSelection(TGLRnrCtx& rnrCtx, TGLSelectRecord& rec) {
0046   // Processes secondary selection from TGLViewer.
0047   // Calls DigitSelected(Int_t) in the model object with index of
0048   // selected point as the argument.
0049 
0050   // printf("FWGeoTopNodeGL::ProcessSelection who knows what we've got ...\n");
0051   // rec.Print();
0052 
0053   TGLViewer* v = dynamic_cast<TGLViewer*>(rnrCtx.GetViewer());
0054   /*
0055    if (v)
0056    {
0057       printf("  but we know the first selection was what we actually want!\n");
0058       printf("  and this is in rnrctx.viewer.selrec\n");
0059       printf("  log=%p, this=%p\n", v->GetSelRec().GetLogShape(), this);
0060    }
0061    */
0062   TGLPhysicalShape* p = v->GetSelRec().GetPhysShape();
0063 
0064   if (rec.GetHighlight()) {
0065     fM->ProcessSelection(rec, fM->fHted, p);
0066   } else {
0067     fM->ProcessSelection(rec, fM->fSted, p);
0068   }
0069 
0070   // Also, do something in UnSelected / UnHighlighted XXXXX
0071 }