Changeset 341


Ignore:
Timestamp:
Apr 20, 2007, 9:32:23 AM (17 years ago)
Author:
barrand
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • MEMPHYS/HEAD/applications/HitsCollectionAccessor.cxx

    r242 r341  
    88#include <Inventor/nodes/SoDrawStyle.h>
    99
    10 //#include <Inventor/nodes/SoCube.h> //FIXME
    11 //#include <Inventor/nodes/SoCylinder.h> //JEC 27/1/06 FIXME
    12 
    1310// HEPVis :
    1411#include <HEPVis/SbPolyhedron.h>
    1512#include <HEPVis/misc/SoStyleCache.h>
     13#include <HEPVis/misc/SoTools.h>
    1614#include <HEPVis/nodes/SoHighlightMaterial.h>
    17 #include <HEPVis/nodes/SoPolyhedron.h>
    1815
    1916#ifdef WIN32
     
    3431MEMPHYS::HitsCollectionAccessor::HitsCollectionAccessor(
    3532 Slash::Core::ISession& aSession
     33,G4RunManager* aRunManager
    3634,const std::string& aHC
    3735)
    38 :G4Lab::HitsCollectionAccessor(aSession,aHC)
     36:G4Lab::HitsCollectionAccessor(aSession,aRunManager,aHC)
    3937//////////////////////////////////////////////////////////////////////////////
    4038//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
     
    6967  separator->setName("sceneGraph");
    7068     
    71  {G4Colour color;
     69 {SoStyleCache* styleCache = fSoGC.getStyleCache();
     70  G4Colour color;
    7271  if(hitColor(*obj,color)) {
    7372    SbColor sbColor((float)color.GetRed(),
     
    7574                    (float)color.GetBlue());
    7675    float transp = 1.0F - (float)color.GetAlpha();
    77     SoStyleCache* styleCache = fSoGC.getStyleCache();
     76    //SbColor sbColor(1,0,0);
     77    //float transp = 0;
     78
    7879    separator->addChild(
    7980      styleCache->getHighlightMaterial
     
    8384  }
    8485  separator->addChild(fSoGC.getDrawStyle());
    85   separator->addChild(fSoGC.getLightModel());}
     86  //separator->addChild(fSoGC.getLightModel());
     87  // Enforce base color (then suppress light effects) :
     88  separator->addChild(styleCache->getLightModelBaseColor());
     89  }
    8690
    8791 {SoTransform* transform = new SoTransform;
     
    103107
    104108  //FIXME : PM base size :
    105 //   double WCPMTRadius           = 0.10*m;  // 20-cm PMTs (8-inch)
     109  //double WCPMTRadius           = 0.10*m;  // 20-cm PMTs (8-inch)
    106110  //JEC 27/1/06 double WCPMTRadius           = 0.10*m;  // 20-cm PMTs (8-inch)
    107   double WCPMTRadius           = 0.15*m;  // PMTs (12-inch)
     111  float WCPMTRadius = 0.15F*m;  // PMTs (12-inch)
    108112
    109   /*
    110   SoCylinder* soPMT = new SoCylinder;
    111   soPMT->radius.setValue(WCPMTRadius);
    112   soPMT->height.setValue(WCPMTRadius);
    113   //JEC what's SoCylinder parts?
    114   separator->addChild(soPMT);
    115   */
     113  SbVec3f normal(0,0,1);
    116114
    117   SbPolyhedronTube sbTube(0,WCPMTRadius,WCPMTRadius/2);
    118   SoPolyhedron* soPMT = new SoPolyhedron(sbTube);
    119   soPMT->setName(name);
    120   //soPMT->radius.setValue(WCPMTRadius);
    121   //soPMT->height.setValue(WCPMTRadius);
    122   //JEC what's SoCylinder parts?
    123   soPMT->setName(name);
    124   separator->addChild(soPMT);
     115  // half size :
     116  float h = WCPMTRadius;
    125117
     118  SbVec3f line[5];
     119  line[0].setValue(+h,-h,0);
     120  line[1].setValue(+h,+h,0);
     121  line[2].setValue(-h,+h,0);
     122  line[3].setValue(-h,-h,0);
     123  line[4].setValue(+h,-h,0);
     124  SoTools::addPolygonToNode(separator,4,line,normal,"");
    126125
    127 //   SoCube* soCube = new SoCube;
    128 //   soCube->width.setValue(WCPMTRadius);
    129 //   soCube->height.setValue(WCPMTRadius);
    130 //   soCube->depth.setValue(WCPMTRadius);
    131 //   soCube->setName(name);
    132        
    133 //   separator->addChild(soCube);
    134          
    135126  fSoRegion->doIt(SbAddNode(separator,"dynamicScene"));
    136127}
Note: See TracChangeset for help on using the changeset viewer.