void viewStarGeometry( const Char_t *tag="y2011", const Char_t *addons="", const Char_t *TOP="HALL", const Char_t *NODE="CAVE_1" ) { cacheGeometry(tag, addons); // Load using TEveManager TEveManager::Create(); // Get the default viewe viewer = gEve->GetDefaultGLViewer(); // Default // Register geometry gEve -> RegisterGeometryAlias("Default", Form("%s.root",tag)); gGeoManager = gEve->GetDefaultGeometry(); // Get the specified top volume and node to draw TGeoNode *CAVE = gGeoManager->FindVolumeFast(TOP)->FindNode(NODE); TEveGeoTopNode *cave = new TEveGeoTopNode( gGeoManager, CAVE ); gEve -> AddGlobalElement(cave); // Draw the scene gEve->Redraw3D(kTRUE); if ( viewall ) { addDetectorTab( "TPCE_1", "TPC" ); addDetectorTab( "CALB_1", "BEMC" ); { addDetectorTab( "CPHI_1", "BEMC module", "CHLV" ); } addDetectorTab( "ECAL_1", "EEMC" ); addDetectorTab( "FBOX_1", "FPD" ); addDetectorTab( "FBO1_3", "FMS N" ); addDetectorTab( "FBO2_4", "FMS S" ); addDetectorTab( "IDSM_1", "IDSM" ); { addDetectorTab( "FGTM_1", "FGT", "IDSM" ); } addDetectorTab( "BBCM_1", "BBC" ); addDetectorTab( "MUTD_1", "MTD" ); addDetectorTab( "BTOF_1", "TOF", "CAVE", 10 ); { addDetectorTab("BTRA_1","TOF tray", "BSEC", 10); } addDetectorTab( "FTPC_1", "FTPC" ); addDetectorTab( "FTPC_1", "FTPC", "SVTT" ); addDetectorTab( "FTRO_1", "FTPC readout" ); addDetectorTab( "SVTT_1", "SVTT" ); addDetectorTab( "SCON_1", "SCON" ); addDetectorTab( "SCON_1", "SCON", "SVTT" ); addDetectorTab( "FSCE_1", "FSCE" ); addDetectorTab( "ETTV_1", "EIDD" ); addDetectorTab( "PIPE_1", "pipe" ); addDetectorTab( "MAGP_1", "magnet" ); }//viewall const Char_t *path = ".:./StarVMC/Geometry/macros/:$STAR/StarVMC/Geometry/macros/"; Char_t *file = gSystem->Which(path,"applyColorScheme.C",kReadPermission); // gROOT->ProcessLine(".L applyColorScheme.C+"); // gROOT->ProcessLine(Form(".L %s+",file)); gSystem->CompileMacro( file, "k-", "libApplyColorScheme", "/tmp" ); applyColorScheme("CAVE"); }
//----------------------------------------------------------------------- void BspSceneManager::renderStaticGeometry(void) { // Check we should be rendering if (!isRenderQueueToBeProcessed(mWorldGeometryRenderQueue)) return; // Cache vertex/face data first vector<StaticFaceGroup*>::type::const_iterator faceGrpi; static RenderOperation patchOp; // no world transform required mDestRenderSystem->_setWorldMatrix(Matrix4::IDENTITY); // Set view / proj setViewMatrix(mCachedViewMatrix); mDestRenderSystem->_setProjectionMatrix(mCameraInProgress->getProjectionMatrixRS()); // For each material in turn, cache rendering data & render MaterialFaceGroupMap::const_iterator mati; for (mati = mMatFaceGroupMap.begin(); mati != mMatFaceGroupMap.end(); ++mati) { // Get Material Material* thisMaterial = mati->first; // Empty existing cache mRenderOp.indexData->indexCount = 0; // lock index buffer ready to receive data unsigned int* pIdx = static_cast<unsigned int*>( mRenderOp.indexData->indexBuffer->lock(HardwareBuffer::HBL_DISCARD)); for (faceGrpi = mati->second.begin(); faceGrpi != mati->second.end(); ++faceGrpi) { // Cache each unsigned int numelems = cacheGeometry(pIdx, *faceGrpi); mRenderOp.indexData->indexCount += numelems; pIdx += numelems; } // Unlock the buffer mRenderOp.indexData->indexBuffer->unlock(); // Skip if no faces to process (we're not doing flare types yet) if (mRenderOp.indexData->indexCount == 0) continue; Technique::PassIterator pit = thisMaterial->getTechnique(0)->getPassIterator(); while (pit.hasMoreElements()) { _setPass(pit.getNext()); mDestRenderSystem->_render(mRenderOp); } } // for each material /* if (mShowNodeAABs) { mDestRenderSystem->_render(mAABGeometry); } */ }