ATLAS Offline Software
Loading...
Searching...
No Matches
VP1GeometrySystem Class Reference

#include <VP1GeometrySystem.h>

Inheritance diagram for VP1GeometrySystem:
Collaboration diagram for VP1GeometrySystem:

Classes

class  Imp

Public Types

typedef std::set< SoCamera * > CamList
typedef CamList::iterator CamListItr
enum  State { CONSTRUCTED =0 , REFRESHED , ERASED , UNCREATED }
enum  ActiveState { ON =0 , OFF }

Public Slots

void reiconizeToShowSpecificMuonChambers (const std::set< GeoPVConstLink > &)
void orientViewToMuonChamber (const GeoPVConstLink &chamberPV)
void setCurvedSurfaceRealism (int)
void muonChamberT0sChanged (const std::map< GeoPVConstLink, float > &, int)
 The map is the dt0 per chamber, plus a label identifier, which by convention (!) is 0=Moore, 1=Muonboy.

Signals

void appropriateMDTProjectionsChanged (int)
void plotSpectrum (QStack< QString > &, int copyNumber=-1)
void itemFromSystemSelected ()
void sysmessage (QString) const
void inactiveSystemTurnedActive ()
void needErase ()

Public Member Functions

 VP1GeometrySystem (const VP1GeoFlags::SubSystemFlags &SubSystemsTurnedOn=VP1GeoFlags::None, const QString &name="Geo")
virtual ~VP1GeometrySystem ()
void setGeometrySelectable (bool)
void setZoomToVolumeOnClick (bool)
void setOrientViewToMuonChambersOnClick (bool)
void setAutoAdaptMuonChambersToEventData (bool)
QWidget * buildController ()
void systemcreate (StoreGateSvc *detstore)
void buildPermanentSceneGraph (StoreGateSvc *detstore, SoSeparator *root)
void buildEventSceneGraph (StoreGateSvc *, SoSeparator *)
void userPickedNode (SoNode *pickedNode, SoPath *pickedPath)
void systemuncreate ()
QByteArray saveState ()
void restoreFromState (QByteArray)
void enableMuonChamberLabels (bool, bool)
 first is t0s, 2nd is hits
void ensureBuildController ()
void updateGUI ()
virtual void systemerase ()
void warnOnDisabledNotifications () const
void registerCamera (SoCamera *camera)
void registerViewer (SoQtViewer *viewer)
void registerSelectionNode (SoCooperativeSelection *)
void unregisterSelectionNode (SoCooperativeSelection *)
void setUserSelectionNotificationsEnabled (SoCooperativeSelection *sel, bool enabled)
virtual void userSelectedSingleNode (SoCooperativeSelection *, SoNode *, SoPath *)
virtual void userDeselectedSingleNode (SoCooperativeSelection *, SoNode *, SoPath *)
virtual void userChangedSelection (SoCooperativeSelection *, const QSet< SoNode * > &, QSet< SoPath * >)
virtual void userClickedOnBgd ()
virtual void deselectAll (SoCooperativeSelection *exception_sel=0)
CamList getCameraList ()
virtual QWidget * buildExtraDisplayWidget ()
const QString & name () const
const QString & information () const
const QString & contact_info () const
QWidget * controllerWidget ()
void message (const QString &) const
void message (const QStringList &, const QString &addtoend="") const
void message (const QString &addtostart, const QStringList &, const QString &addtoend="") const
void messageDebug (const QString &) const
void messageDebug (const QStringList &, const QString &addtoend="") const
void messageDebug (const QString &addtostart, const QStringList &, const QString &addtoend="") const
void messageVerbose (const QString &) const
void messageVerbose (const QStringList &, const QString &addtoend="") const
void messageVerbose (const QString &addtostart, const QStringList &, const QString &addtoend="") const
StoreGateSvcstoreGate () const
StoreGateSvceventStore () const
StoreGateSvcdetectorStore () const
ISvcLocator * serviceLocator () const
IToolSvc * toolSvc () const
State state () const
ActiveState activeState () const

Static Public Member Functions

static bool verbose ()
static QString str (const QString &s)
static QString str (const char *c)
static QString str (const bool b)
static QString str (const QColor &)
static QString str (const SbColor &)
static QString str (const VP1Interval &)
static QString str (const SbVec2d &)
static QString str (const SbVec2f &)
static QString str (const SbVec2s &)
static QString str (const SbVec3d &)
static QString str (const SbVec3f &)
static QString str (const SbVec3s &)
static QString str (const SbVec4d &)
static QString str (const SbVec4f &)
static QString str (short int n)
static QString str (unsigned short int n)
static QString str (long n)
static QString str (ulong n)
static QString str (int n)
static QString str (uint n)
static QString str (qlonglong n)
static QString str (qulonglong n)
static QString str (const double &d)
static QString str (const float &f)
static QString str (const void *)
template<class T>
static QString str (const T *t)
template<class T>
static QString str (const QFlags< T > &f)
template<class T>
static QString str (const HepGeom::BasicVector3D< T > &t)
static QString str (const Amg::Vector3D &t)
template<class T>
static QString str (const QList< T > &t)

Protected Slots

void checkboxChanged ()
void updateTransparency ()
void adaptMuonChambersToEventData ()
void adaptMuonChambersStyleChanged ()
void emit_appropriateMDTProjectionsChanged ()
void autoAdaptPixelsOrSCT (bool, bool, bool, bool, bool, bool)
void autoAdaptMuonNSW (bool reset, bool stgc, bool mm, bool passiveSpacer, bool passiveStructure, bool passiveAPlate)
void resetSubSystems (VP1GeoFlags::SubSystemFlags)
void autoExpandByVolumeOrMaterialName (bool, const QString &)
void autoIconifyByVolumeOrMaterialName (bool, const QString &)
void actionOnAllNonStandardVolumes (bool)
void volumeStateChangeRequested (VolumeHandle *, VP1GeoFlags::VOLSTATE)
void volumeResetRequested (VolumeHandle *)
void setShowVolumeOutLines (bool)
void saveMaterialsToFile (const QString &, bool)
void loadMaterialsFromFile (const QString &)
void setLabels (int)
void setLabelPosOffsets (const QList< int > &)

Protected Member Functions

void registerController (QWidget *)

Protected Attributes

Impm_d

Private Slots

void activateClickedOutside ()

Private Member Functions

SoSeparator * getSceneGraph () const
void create (StoreGateSvc *detstore)
void refresh (StoreGateSvc *storegate)
void erase ()
void uncreate ()
void disallowUpdateGUI ()
void allowUpdateGUI ()
void setChannel (IVP1ChannelWidget *)
IVP1ChannelWidgetchannel () const
void deleteController ()
void setState (const State &)
void setActiveState (const ActiveState &, const bool &donttriggererase=true)
bool isRefreshing ()
void setRefreshing (const bool &)
void setCanRegisterController (const bool &)

Static Private Attributes

static const bool s_vp1verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")

Detailed Description

Definition at line 33 of file VP1GeometrySystem.h.

Member Typedef Documentation

◆ CamList

typedef std::set<SoCamera*> IVP13DSystem::CamList
inherited

Definition at line 90 of file IVP13DSystem.h.

◆ CamListItr

typedef CamList::iterator IVP13DSystem::CamListItr
inherited

Definition at line 91 of file IVP13DSystem.h.

Member Enumeration Documentation

◆ ActiveState

enum IVP1System::ActiveState
inherited
Enumerator
ON 
OFF 

Definition at line 144 of file IVP1System.h.

144{ ON=0, OFF };//Whether it is part of the erase/refresh cycle.

◆ State

enum IVP1System::State
inherited
Enumerator
CONSTRUCTED 
REFRESHED 
ERASED 
UNCREATED 

Definition at line 143 of file IVP1System.h.

Constructor & Destructor Documentation

◆ VP1GeometrySystem()

VP1GeometrySystem::VP1GeometrySystem ( const VP1GeoFlags::SubSystemFlags & SubSystemsTurnedOn = VP1GeoFlags::None,
const QString & name = "Geo" )

Definition at line 303 of file VP1GeometrySystem.cxx.

305 "This system displays the geometry as defined in the GeoModel tree.",
306 "Riccardo.Maria.Bianchi@cern.ch"),
307 m_d(new Imp(this,SubSystemsTurnedOn))
308{
309}
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
const QString & name() const

◆ ~VP1GeometrySystem()

VP1GeometrySystem::~VP1GeometrySystem ( )
virtual

Definition at line 328 of file VP1GeometrySystem.cxx.

329{
330 delete m_d;
331 m_d = 0;
332}

Member Function Documentation

◆ actionOnAllNonStandardVolumes

void VP1GeometrySystem::actionOnAllNonStandardVolumes ( bool zap)
protectedslot

Definition at line 2027 of file VP1GeometrySystem.cxx.

2028{
2030 messageVerbose("Action on volumes with non-standard VRML representations. Target state is "+VP1GeoFlags::toString(target));
2031
2032 std::vector<std::pair<VolumeHandle::VolumeHandleListItr,VolumeHandle::VolumeHandleListItr> > roothandles;
2033 m_d->volumetreemodel->getRootHandles(roothandles);
2035
2036 bool save = m_d->sceneroot->enableNotify(false);
2037 m_d->phisectormanager->largeChangesBegin();
2038
2039 deselectAll();
2040
2041 for (unsigned i = 0; i<roothandles.size();++i) {
2042 it = roothandles.at(i).first;
2043 itE = roothandles.at(i).second;
2044 for(;it!=itE;++it) {
2045 m_d->changeStateOfVisibleNonStandardVolumesRecursively(*it,target);
2046 }
2047 }
2048
2049 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2050 m_d->phisectormanager->largeChangesEnd();
2051 if (save) {
2052 m_d->sceneroot->enableNotify(true);
2053 m_d->sceneroot->touch();
2054 }
2055}
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)
void messageVerbose(const QString &) const
static QString toString(const VOLSTATE &)
VolumeHandleList::iterator VolumeHandleListItr

◆ activateClickedOutside

void IVP13DSystem::activateClickedOutside ( )
privateslotinherited

Definition at line 85 of file IVP13DSystem.cxx.

86{
87 if (!m_d->clickedoutsideScheduled)
88 return;
89 m_d->clickedoutsideScheduled = false;
91}
virtual void userClickedOnBgd()

◆ activeState()

IVP1System::ActiveState IVP1System::activeState ( ) const
inherited

Definition at line 135 of file IVP1System.cxx.

136{
137 return m_d->activeState;
138}

◆ adaptMuonChambersStyleChanged

void VP1GeometrySystem::adaptMuonChambersStyleChanged ( )
protectedslot

Definition at line 1577 of file VP1GeometrySystem.cxx.

1578{
1579 //Make all chamber representations dirty:
1580 std::map<PVConstLink,VolumeHandle*>::iterator it, itE=m_d->muonchambers_pv2handles.end();
1581 for (it=m_d->muonchambers_pv2handles.begin();it!=itE;++it)
1582 it->second->setMuonChamberDirty(true);
1583
1584 //Adapt immediately if necessary:
1585 if (m_d->controller->autoAdaptMuonChambersToEventData())
1588}
void emit_appropriateMDTProjectionsChanged()

◆ adaptMuonChambersToEventData

void VP1GeometrySystem::adaptMuonChambersToEventData ( )
protectedslot

Definition at line 1539 of file VP1GeometrySystem.cxx.

1540{
1541 if (m_d->muonchambers_pv2handles.empty())
1542 return;
1543
1544 std::set<GeoPVConstLink> allchambers;
1545 if (!m_d->sender2ChamberList.empty()) {
1546 allchambers = (m_d->sender2ChamberList.begin())->second;
1547 std::map<QObject*,std::set<GeoPVConstLink> >::iterator itLists,itListsE(m_d->sender2ChamberList.end());
1548 for (itLists = m_d->sender2ChamberList.begin(),++itLists;itLists != itListsE;++itLists) {
1549 allchambers.insert(itLists->second.begin(),itLists->second.end());
1550 }
1551 }
1552
1553 //Idea: Maybe just iconise them all and then selectively deiconise the few? Then we can avoid most searches!
1554 bool save = m_d->sceneroot->enableNotify(false);
1555 m_d->phisectormanager->largeChangesBegin();
1556
1557 deselectAll();
1558 std::map<PVConstLink,VolumeHandle*>::iterator it, itE=m_d->muonchambers_pv2handles.end();
1559 std::set<GeoPVConstLink>::iterator itchambersE = allchambers.end();
1560 for (it=m_d->muonchambers_pv2handles.begin();it!=itE;++it) {
1561 if (allchambers.find(it->first)==itchambersE)
1562 it->second->setState(VP1GeoFlags::ZAPPED);
1563 else {
1564 if (it->second->muonChamberDirty())
1565 m_d->updateTouchedMuonChamber(it->second);
1566 }
1567 }
1568 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
1569 m_d->phisectormanager->largeChangesEnd();
1570 if (save) {
1571 m_d->sceneroot->enableNotify(true);
1572 m_d->sceneroot->touch();
1573 }
1574}

◆ allowUpdateGUI()

void IVP1System::allowUpdateGUI ( )
privateinherited

Definition at line 256 of file IVP1System.cxx.

257{
258 m_d->allowupdategui=true;
259}

◆ appropriateMDTProjectionsChanged

void VP1GeometrySystem::appropriateMDTProjectionsChanged ( int )
signal

◆ autoAdaptMuonNSW

void VP1GeometrySystem::autoAdaptMuonNSW ( bool reset,
bool stgc,
bool mm,
bool passiveSpacer,
bool passiveStructure,
bool passiveAPlate )
protectedslot

Definition at line 2354 of file VP1GeometrySystem.cxx.

2355{
2356 VP1Msg::messageDebug("VP1GeometrySystem::autoAdaptMuonNSW()");
2357
2358 #ifndef BUILDVP1LIGHT
2359 // return if Muon and MuonNSW are not configured/present/ON
2361 return;
2362 #endif
2363
2364 if( reset )
2365 VP1Msg::messageDebug("resetting to full NSW...");
2366
2368
2370 //Find subsystem:
2371 Imp::SubSystemInfo* subsys(0);
2372 for (Imp::SubSystemInfo*si : m_d->subsysInfoList) {
2373 if (si->flag == subSysFlag) {
2374 subsys = si;
2375 break;
2376 }
2377 }
2378 if (!subsys) {
2379 message("autoAdaptMuonNSW Error: Could not find subsystem");
2380 return;
2381 }
2382
2383
2385 //Abort if corresponding subsystem is not built:
2386 if (!subsys->isbuilt) {
2387 VP1Msg::messageDebug("autoAdaptMuonNSW: Aborting since subsystem geometry not built yet");
2388 return;//Disabling now due to phi-sector problems if "click some phi sectors"->"adapt pixel"->"turn on pixel"
2389 }
2390 bool save = m_d->sceneroot->enableNotify(false);
2391 m_d->phisectormanager->largeChangesBegin();
2392
2393 VolumeHandle::VolumeHandleListItr it(subsys->vollist.begin()),itE(subsys->vollist.end());
2394
2395 // loop over first level children (i.e., 'NewSmallWheel')
2396 for (;it!=itE;++it) {
2397
2398 (*it)->initialiseChildren();
2399 (*it)->setState(VP1GeoFlags::CONTRACTED);
2400 VolumeHandle::VolumeHandleListItr itChl((*it)->childrenBegin()),itChlE((*it)->childrenEnd());
2401
2402 // loop over second level children (i.e., 'NSW_sTGC', 'NSW_MM')
2403 for (;itChl!=itChlE;++itChl) {
2404
2405 bool unzap( reset? true : false );
2406
2407 if ( !reset ) {
2408 (*itChl)->setState(VP1GeoFlags::ZAPPED);
2409 if ( (stgc) && (*itChl)->hasName("NSW_sTGC") ) {
2410 unzap = true;
2411 //m_d->showPixelModules(*itChl);
2412 } else if ( (mm) && (*itChl)->hasName("NSW_MM") ) {
2413 unzap = true;
2414 //m_d->showPixelModules(*itChl);
2415 } else if ( (passiveSpacer) && (*itChl)->hasName("NSW_Spacer") ) {
2416 unzap = true;
2417 } else if ( (passiveStructure) && (*itChl)->hasName("NSW_Aluminum_Structure_and_HUB") ) {
2418 unzap = true;
2419 } else if ( (passiveAPlate) && (*itChl)->hasName("A_Plate") ) {
2420 unzap = true;
2421 }
2422 }
2423 if (unzap) {
2424 (*itChl)->setState(VP1GeoFlags::EXPANDED);
2425 }
2426 }
2427 (*it)->setState(VP1GeoFlags::EXPANDED);
2428 }
2429
2430 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2431 m_d->phisectormanager->largeChangesEnd();
2432
2433 if (save) {
2434 m_d->sceneroot->enableNotify(true);
2435 m_d->sceneroot->touch();
2436 }
2437}
void message(const QString &) const
@ MuonEndcapStationNSW
Definition VP1GeoFlags.h:65
static bool hasMuonNSWGeometry()
static bool hasMuonGeometry()
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39

◆ autoAdaptPixelsOrSCT

void VP1GeometrySystem::autoAdaptPixelsOrSCT ( bool pixel,
bool brl,
bool ecA,
bool ecC,
bool bcmA,
bool bcmC )
protectedslot

Definition at line 2247 of file VP1GeometrySystem.cxx.

2248{
2249 #ifndef BUILDVP1LIGHT
2251 return;
2252 #endif
2254
2255 bool bcm(bcmA||bcmC);
2256 bool ec(ecA||ecC);
2257
2259 //Find subsystem:
2260 Imp::SubSystemInfo* subsys(0);
2261 for (Imp::SubSystemInfo*si : m_d->subsysInfoList) {
2262 if (si->flag == subSysFlag) {
2263 subsys = si;
2264 break;
2265 }
2266 }
2267 if (!subsys) {
2268 message("AutoAdaptPixelsOrSCT Error: Could not find subsystem");
2269 return;
2270 }
2271
2272
2274 //Abort if corresponding subsystem is not built:
2275 if (!subsys->isbuilt) {
2276 VP1Msg::messageDebug("AutoAdaptPixelsOrSCT: Aborting since subsystem geometry not built yet");
2277 return;//Disabling now due to phi-sector problems if "click some phi sectors"->"adapt pixel"->"turn on pixel"
2278 }
2279 bool save = m_d->sceneroot->enableNotify(false);
2280 m_d->phisectormanager->largeChangesBegin();
2281 VolumeHandle::VolumeHandleListItr it(subsys->vollist.begin()),itE(subsys->vollist.end());
2282
2283 if (pixel) {
2284 // --> Pixel
2285 for (;it!=itE;++it) {
2286 (*it)->initialiseChildren();
2287 (*it)->setState(VP1GeoFlags::CONTRACTED);
2288 VolumeHandle::VolumeHandleListItr itChl((*it)->childrenBegin()),itChlE((*it)->childrenEnd());
2289 for (;itChl!=itChlE;++itChl) {
2290 bool unzap(false);
2291 (*itChl)->setState(VP1GeoFlags::ZAPPED);
2293 if (brl&&(*itChl)->hasName("barrelLog")) {
2294 unzap = true;
2295 m_d->showPixelModules(*itChl);
2296 } else if ((ec)&&(*itChl)->hasName("EndCapLog")) {
2297 if (((*itChl)->isPositiveZ()?ecA:ecC)) {
2298 m_d->showPixelModules(*itChl);
2299 unzap = true;
2300 }
2301 } else if (bcm&&(*itChl)->hasName("bcmModLog")) {
2302 if (((*itChl)->isPositiveZ()?bcmA:bcmC)) {
2303 (*itChl)->reset();
2304 (*itChl)->setState(VP1GeoFlags::EXPANDED);
2305 }
2306 }
2307 } else {
2308 if ((*itChl)->hasName("ITkPixelDetector")) {
2309 m_d->showITkPixelModules(*itChl, brl, ecA, ecC);
2310 unzap = true;
2311 }
2312 }
2313 if (unzap)
2314 (*itChl)->setState(VP1GeoFlags::EXPANDED);
2315 }
2316 (*it)->setState(VP1GeoFlags::EXPANDED);
2317 }
2318 } else {
2319 // --> SCT
2320 for (;it!=itE;++it) {
2321 (*it)->initialiseChildren();
2322 (*it)->setState(VP1GeoFlags::CONTRACTED);
2323 bool unzap(false);
2324 (*it)->setState(VP1GeoFlags::ZAPPED);
2326 if (brl&&(*it)->hasName("SCT_Barrel")) {
2327 unzap = true;
2328 m_d->showSCTBarrelModules(*it);
2329 } else if (ecA&&(*it)->hasName("SCT_ForwardA")) {
2330 unzap = true;
2331 m_d->showSCTEndcapModules(*it);
2332 } else if (ecC&&(*it)->hasName("SCT_ForwardC")) {
2333 unzap = true;
2334 m_d->showSCTEndcapModules(*it);
2335 }
2336 } else {
2337 m_d->showITkStripModules(*it, brl, ecA, ecC);
2338 unzap=true;
2339 }
2340 if (unzap)
2341 (*it)->setState(VP1GeoFlags::EXPANDED);
2342 }
2343 }
2344 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2345 m_d->phisectormanager->largeChangesEnd();
2346 if (save) {
2347 m_d->sceneroot->enableNotify(true);
2348 m_d->sceneroot->touch();
2349 }
2350}
static bool hasPixelGeometry()
static bool hasSCTGeometry()
static bool hasITkGeometry()

◆ autoExpandByVolumeOrMaterialName

void VP1GeometrySystem::autoExpandByVolumeOrMaterialName ( bool bymatname,
const QString & targetname )
protectedslot

Definition at line 2058 of file VP1GeometrySystem.cxx.

2059{
2060 if (targetname.isEmpty()) {
2061 VP1Msg::messageDebug("targetname is empty.");
2062 return;
2063 }
2064
2065 messageVerbose("Auto expansions of visible volumes requested. Target all volumes with "
2066 +str(bymatname?"material name":"name")+" matching "+targetname);
2067
2068 QRegExp selregexp(targetname,Qt::CaseSensitive,QRegExp::Wildcard);
2069
2070 std::vector<std::pair<VolumeHandle::VolumeHandleListItr,VolumeHandle::VolumeHandleListItr> > roothandles;
2071 m_d->volumetreemodel->getRootHandles(roothandles);
2073
2074 bool save = m_d->sceneroot->enableNotify(false);
2075 m_d->phisectormanager->largeChangesBegin();
2076
2077 deselectAll();
2078
2079 for (unsigned i = 0; i<roothandles.size();++i) {
2080 it = roothandles.at(i).first;
2081 itE = roothandles.at(i).second;
2082 for(;it!=itE;++it)
2083 m_d->expandVisibleVolumesRecursively(*it,selregexp,bymatname);
2084 }
2085
2086 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2087 m_d->phisectormanager->largeChangesEnd();
2088 if (save) {
2089 m_d->sceneroot->enableNotify(true);
2090 m_d->sceneroot->touch();
2091 }
2092}
static QString str(const QString &s)
Definition VP1String.h:49

◆ autoIconifyByVolumeOrMaterialName

void VP1GeometrySystem::autoIconifyByVolumeOrMaterialName ( bool bymatname,
const QString & targetname )
protectedslot

Definition at line 2138 of file VP1GeometrySystem.cxx.

2139{
2140 if (targetname.isEmpty()) {
2141 VP1Msg::messageDebug("targetname is empty.");
2142 return;
2143 }
2144
2145 messageVerbose("Auto iconification/zapping of visible volumes requested. Target all volumes with "
2146 +str(bymatname?"material name":"name")+" matching "+targetname);
2147
2148 QRegExp selregexp(targetname,Qt::CaseSensitive,QRegExp::Wildcard);
2149
2150 std::vector<std::pair<VolumeHandle::VolumeHandleListItr,VolumeHandle::VolumeHandleListItr> > roothandles;
2151 m_d->volumetreemodel->getRootHandles(roothandles);
2153
2154 bool save = m_d->sceneroot->enableNotify(false);
2155 m_d->phisectormanager->largeChangesBegin();
2156
2157 deselectAll();
2158
2159 for (unsigned i = 0; i<roothandles.size();++i) {
2160 it = roothandles.at(i).first;
2161 itE = roothandles.at(i).second;
2162 for(;it!=itE;++it)
2163 m_d->iconifyVisibleVolumesRecursively(*it,selregexp,bymatname);
2164 }
2165
2166 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2167 m_d->phisectormanager->largeChangesEnd();
2168 if (save) {
2169 m_d->sceneroot->enableNotify(true);
2170 m_d->sceneroot->touch();
2171 }
2172}

◆ buildController()

QWidget * VP1GeometrySystem::buildController ( )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 384 of file VP1GeometrySystem.cxx.

385{
386 message("VP1GeometrySystem::buildController");
387
388 m_d->controller = new GeoSysController(this);
389
390 m_d->phisectormanager = new PhiSectorManager(m_d->controller->phiSectionWidget(),this,this);
391
392
393 connect(m_d->controller,SIGNAL(showVolumeOutLinesChanged(bool)),this,SLOT(setShowVolumeOutLines(bool)));
394 setShowVolumeOutLines(m_d->controller->showVolumeOutLines());
395 connect(m_d->controller,SIGNAL(saveMaterialsToFile(QString,bool)),this,SLOT(saveMaterialsToFile(QString,bool)));
396 connect(m_d->controller,SIGNAL(loadMaterialsFromFile(QString)),this,SLOT(loadMaterialsFromFile(QString)));
397
398 connect(m_d->controller,SIGNAL(transparencyChanged(float)),this,SLOT(updateTransparency()));
399 connect (m_d->controller,SIGNAL(volumeStateChangeRequested(VolumeHandle*,VP1GeoFlags::VOLSTATE)),
400 this,SLOT(volumeStateChangeRequested(VolumeHandle*,VP1GeoFlags::VOLSTATE)));
401 connect (m_d->controller,SIGNAL(volumeResetRequested(VolumeHandle*)),
402 this,SLOT(volumeResetRequested(VolumeHandle*)));
403 connect(m_d->controller,SIGNAL(adaptMuonChambersToEventData()),this,SLOT(adaptMuonChambersToEventData()));
404 connect(m_d->controller,SIGNAL(muonChamberAdaptionStyleChanged(VP1GeoFlags::MuonChamberAdaptionStyleFlags)),
405 this,SLOT(adaptMuonChambersStyleChanged()));
406 connect(m_d->controller,SIGNAL(autoExpandByVolumeOrMaterialName(bool,QString)),this,SLOT(autoExpandByVolumeOrMaterialName(bool,QString)));
407 connect(m_d->controller,SIGNAL(autoIconifyByVolumeOrMaterialName(bool,QString)),this,SLOT(autoIconifyByVolumeOrMaterialName(bool,QString)));
408 connect(m_d->controller,SIGNAL(actionOnAllNonStandardVolumes(bool)),this,SLOT(actionOnAllNonStandardVolumes(bool)));
409 connect(m_d->controller,SIGNAL(autoAdaptPixelsOrSCT(bool,bool,bool,bool,bool,bool)),this,SLOT(autoAdaptPixelsOrSCT(bool,bool,bool,bool,bool,bool)));
410 connect(m_d->controller,SIGNAL(autoAdaptMuonNSW(bool,bool,bool,bool,bool,bool)),this,SLOT(autoAdaptMuonNSW(bool, bool,bool,bool,bool,bool)));
411 connect(m_d->controller,SIGNAL(resetSubSystems(VP1GeoFlags::SubSystemFlags)),this,SLOT(resetSubSystems(VP1GeoFlags::SubSystemFlags)));
412
413 connect(m_d->controller,SIGNAL(labelsChanged(int)),this,SLOT(setLabels(int)));
414 connect(m_d->controller,SIGNAL(labelPosOffsetChanged(QList<int>)),this,SLOT(setLabelPosOffsets(QList<int>)));
415 setLabels(m_d->controller->labels());
416
417
418 /* This is where we define the available different subsystems and their location in the geomodel tree.
419 *
420 * if the reg expr does not match any volume, the corresponding subsystem checkbox in the Geo GUI gets disabled.
421 *
422 * syntax: addSubSystem(VP1GeoFlags::SubSystemFlag&, // the associated system flag
423 QString& treetopregexp, // the regular expr for the top/root name of the main sub-detector system
424 QString& childrenregexp="", // the reg expr for the children of the main sub-detector
425 std::string& matname="", // a name we choose for displaying in VP1
426 bool negatetreetopregexp = false, // if we want to negate the top reg expr
427 bool negatechildrenregexp = false); // if we want to negate the children reg expr
428 const QString& grandchildrenregexp="", // the regex for granchildren of the main sub-detector
429 bool negategrandchildrenregexp = false // wheter we want to negate teh granchildren regex
430 */
431
433 m_d->addSubSystem( VP1GeoFlags::Pixel,"ITkPixel", "", "ITkPixel");
434 m_d->addSubSystem( VP1GeoFlags::SCT,"ITkStrip", "", "ITkStrip");
435 } else {
436 m_d->addSubSystem( VP1GeoFlags::Pixel,"Pixel");
437 m_d->addSubSystem( VP1GeoFlags::SCT,"SCT");
438 }
439 m_d->addSubSystem( VP1GeoFlags::TRT,"TRT");
440 m_d->addSubSystem( VP1GeoFlags::InDetServMat,"InDetServMat");
441 m_d->addSubSystem( VP1GeoFlags::LAr, ".*LAr.*");
442 m_d->addSubSystem( VP1GeoFlags::Tile,"Tile");
443 m_d->addSubSystem( VP1GeoFlags::CavernInfra,"CavernInfra");
444 m_d->addSubSystem( VP1GeoFlags::BeamPipe,"BeamPipe");
445 m_d->addSubSystem( VP1GeoFlags::LUCID,".*Lucid.*");
446 m_d->addSubSystem( VP1GeoFlags::ZDC,".*ZDC.*");
447 m_d->addSubSystem( VP1GeoFlags::ALFA,".*ALFA.*");
448 m_d->addSubSystem( VP1GeoFlags::AFP,".*AFP.*");
449 m_d->addSubSystem( VP1GeoFlags::ForwardRegion,".*ForwardRegion.*");
450
451 //The muon systems require special treatment, since we want to
452 //cherrypick below the treetop (this is the main reason for a lot
453 //of the ugly stuff in this class):
454 m_d->addSubSystem( VP1GeoFlags::MuonEndcapStationCSC,"Muon","CS.*","CSC");
455 m_d->addSubSystem( VP1GeoFlags::MuonEndcapStationTGC,"Muon","T(1|2|3|4).*","TGC");
456 m_d->addSubSystem( VP1GeoFlags::MuonEndcapStationMDT,"Muon","(EI|EM|EO|EE).*","EndcapMdt");
457 m_d->addSubSystem( VP1GeoFlags::MuonEndcapStationNSW,"Muon",".*ANON.*","MuonNSW",false, false, "NewSmallWheel.*");
458
459 m_d->addSubSystem( VP1GeoFlags::MuonBarrelStationInner,"Muon","(BI|BEE).*","BarrelInner");
460 m_d->addSubSystem( VP1GeoFlags::MuonBarrelStationMiddle,"Muon","BM.*","BarrelMiddle");
461 m_d->addSubSystem( VP1GeoFlags::MuonBarrelStationOuter,"Muon","BO.*","BarrelOuter");
462
463 //This last one is even more horrible. We want everything from the Muon treetop that is NOT included elsewhere:
464// m_d->addSubSystem( VP1GeoFlags::MuonToroidsEtc,"Muon","(CS|T1|T2|T3|T4|EI|EM|EO|EE|BI|BEE|BM|BO).*","Muon",false,true);
465
466 // Toroid
467 m_d->addSubSystem( VP1GeoFlags::BarrelToroid,"Muon",".*ANON.*","BarrelToroid", false, false, "BAR_Toroid.*");
468 m_d->addSubSystem( VP1GeoFlags::ToroidECA,"Muon",".*ANON.*","ToroidECA", false, false, "ECT_Toroids.*");
469// m_d->addSubSystem( VP1GeoFlags::ToroidECC,"Muon",".*ANON.*","ToroidECC", false, false, "ECT_Toroids");
470
471 // Muon Feet
472 m_d->addSubSystem( VP1GeoFlags::MuonFeet,"Muon",".*ANON.*","MuonFeet", false, false, "Feet.*");
473
474 // Muon shielding
475 m_d->addSubSystem( VP1GeoFlags::MuonShielding,"Muon",".*ANON.*","Shielding", false, false, "(JDSH|JTSH|JFSH).*");
476
477
478 // All muon stuff --> this will be linked to the "Services" checkbox in the GUI
479 // m_d->addSubSystem( VP1GeoFlags::MuonToroidsEtc,"Muon","(CS|T1|T2|T3|T4|EI|EM|EO|EE|BI|BEE|BM|BO).*","MuonEtc",false,true);
480 m_d->addSubSystem( VP1GeoFlags::MuonToroidsEtc,"Muon",".*(CS|T1|T2|T3|T4|EI|EM|EO|EE|BI|BEE|BM|BO).*","MuonEtc",false,true,"(ECT_Toroids|BAR_Toroid|Feet|NewSmallWheel|JDSH|JTSH|JFSH).*",true);
481
482 // m_d->addSubSystem( VP1GeoFlags::MuonToroidsEtc,"Muon","*.Feet.*","MuonEtc");
483
484 //This one MUST be added last. It will get slightly special treatment in various places!
485 m_d->addSubSystem( VP1GeoFlags::AllUnrecognisedVolumes,".*");
486
487
488 //Setup models/views for volume tree browser and zapped volumes list:
489 m_d->volumetreemodel = new VolumeTreeModel(m_d->controller->volumeTreeBrowser());
490 m_d->controller->volumeTreeBrowser()->header()->hide();
491 m_d->controller->volumeTreeBrowser()->uniformRowHeights();
492 m_d->controller->volumeTreeBrowser()->setModel(m_d->volumetreemodel);
493
494 return m_d->controller;
495}
@ MuonEndcapStationTGC
Definition VP1GeoFlags.h:47
@ AllUnrecognisedVolumes
Definition VP1GeoFlags.h:73
@ MuonBarrelStationInner
Definition VP1GeoFlags.h:42
@ MuonBarrelStationMiddle
Definition VP1GeoFlags.h:44
@ MuonBarrelStationOuter
Definition VP1GeoFlags.h:45
@ MuonEndcapStationCSC
Definition VP1GeoFlags.h:46
@ MuonEndcapStationMDT
Definition VP1GeoFlags.h:49
void loadMaterialsFromFile(const QString &)
void autoAdaptMuonNSW(bool reset, bool stgc, bool mm, bool passiveSpacer, bool passiveStructure, bool passiveAPlate)
void resetSubSystems(VP1GeoFlags::SubSystemFlags)
void autoIconifyByVolumeOrMaterialName(bool, const QString &)
void volumeResetRequested(VolumeHandle *)
void autoAdaptPixelsOrSCT(bool, bool, bool, bool, bool, bool)
void volumeStateChangeRequested(VolumeHandle *, VP1GeoFlags::VOLSTATE)
void setLabelPosOffsets(const QList< int > &)
void autoExpandByVolumeOrMaterialName(bool, const QString &)
void actionOnAllNonStandardVolumes(bool)
void saveMaterialsToFile(const QString &, bool)

◆ buildEventSceneGraph()

void VP1GeometrySystem::buildEventSceneGraph ( StoreGateSvc * ,
SoSeparator *  )
inlinevirtual

Implements IVP13DSystemSimple.

Definition at line 55 of file VP1GeometrySystem.h.

55{}

◆ buildExtraDisplayWidget()

virtual QWidget * IVP13DSystem::buildExtraDisplayWidget ( )
inlinevirtualinherited

Definition at line 106 of file IVP13DSystem.h.

106{ return 0; }

◆ buildPermanentSceneGraph()

void VP1GeometrySystem::buildPermanentSceneGraph ( StoreGateSvc * detstore,
SoSeparator * root )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 512 of file VP1GeometrySystem.cxx.

513{
514 m_d->sceneroot = root;
515
516 #ifndef BUILDVP1LIGHT
518 message("Error: GeoModel not configured properly in job.");
519 return;
520 }
521
522 //Get the world volume:
523 const GeoModelExperiment * theExpt;
524 if (!VP1SGAccessHelper(this,true).retrieve(theExpt,"ATLAS")) {
525 message("Error: Could not retrieve the ATLAS GeoModelExperiment from detector store");
526 return;
527 }
528 #endif
529
530 #ifdef BUILDVP1LIGHT
531 GeoModelExperiment* theExpt = m_d->getGeometry();
532 #endif
533 PVConstLink world(theExpt->getPhysVol());
534
535 if (!m_d->m_textSep) {
536 // FIXME!
537 // std::cout<<"Making new Text sep"<<std::endl;
538 m_d->m_textSep = new SoSeparator;
539 m_d->m_textSep->setName("TextSep");
540 m_d->m_textSep->ref();
541 }
542 m_d->sceneroot->addChild(m_d->m_textSep);
543
544 // FIXME - what if font is missing?
545 SoFont *myFont = new SoFont;
546 myFont->name.setValue("Arial");
547 myFont->size.setValue(12.0);
548 m_d->m_textSep->addChild(myFont);
549
550 bool save = root->enableNotify(false);
551
552 //Catch keyboard events:
553 SoEventCallback *catchEvents = new SoEventCallback();
554 catchEvents->addEventCallback(SoKeyboardEvent::getClassTypeId(),Imp::catchKbdState, m_d);
555 root->addChild(catchEvents);
556
557 root->addChild(m_d->controller->drawOptions());
558 root->addChild(m_d->controller->pickStyle());
559
560 if(VP1Msg::debug()){
561 qDebug() << "Configuring the default systems... - subsysInfoList len:" << (m_d->subsysInfoList).length();
562 }
563 // we switch on the systems flagged to be turned on at start
564 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList)
565 {
566 VP1Msg::messageDebug("Switching on this system: " + QString::fromStdString(subsys->matname) + " - " + subsys->flag);
567 bool on(m_d->initialSubSystemsTurnedOn & subsys->flag);
568 subsys->checkbox->setChecked( on );
569 subsys->checkbox->setEnabled(false);
570 subsys->checkbox->setToolTip("This sub-system is not available");
571 connect(subsys->checkbox,SIGNAL(toggled(bool)),this,SLOT(checkboxChanged()));
572 }
573
574 //Locate geometry info for the various subsystems, and add the info as appropriate:
575
576 QCheckBox * checkBoxOther = m_d->controller->subSystemCheckBox(VP1GeoFlags::AllUnrecognisedVolumes);
577
578 if(VP1Msg::debug()){
579 qDebug() << "Looping on volumes from the input GeoModel...";
580 }
581 GeoVolumeCursor av(world);
582 while (!av.atEnd()) {
583
584 std::string name = av.getName();
585 if(VP1Msg::debug()){
586 qDebug() << "volume name:" << QString::fromStdString(name);
587 }
588
589 // DEBUG
590 VP1Msg::messageDebug("DEBUG: Found GeoModel treetop: "+QString(name.c_str()));
591
592 //Let us see if we recognize this volume:
593 bool found = false;
594 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList) {
595 if (subsys->negatetreetopregexp!=subsys->geomodeltreetopregexp.exactMatch(name.c_str()))
596 {
597 if (subsys->checkbox==checkBoxOther&&found) {
598 continue;//The "other" subsystem has a wildcard which matches everything - but we only want stuff that is nowhere else.
599 }
600
601 if(VP1Msg::debug()){
602 qDebug() << (subsys->geomodeltreetopregexp).pattern() << subsys->geomodeltreetopregexp.exactMatch(name.c_str()) << subsys->negatetreetopregexp;
603 qDebug() << "setting 'found' to TRUE for pattern:" << (subsys->geomodeltreetopregexp).pattern();
604 }
605 found = true;
606 //We did... now, time to extract info:
607 subsys->treetopinfo.resize(subsys->treetopinfo.size()+1);
608 subsys->treetopinfo.back().pV = av.getVolume();
609 subsys->treetopinfo.back().xf = Amg::EigenTransformToCLHEP(av.getTransform());
610 subsys->treetopinfo.back().volname = av.getName();
611
612 //Add a switch for this system (turned off for now):
613 SoSwitch * sw = new SoSwitch();
614 //But add a separator on top of it (for caching):
615 subsys->soswitch = sw;
616 if (sw->whichChild.getValue() != SO_SWITCH_NONE)
617 sw->whichChild = SO_SWITCH_NONE;
618 SoSeparator * sep = new SoSeparator;
619 sep->addChild(sw);
620 root->addChild(sep);
621 //Enable the corresponding checkbox:
622 subsys->checkbox->setEnabled(true);
623 subsys->checkbox->setToolTip("Toggle the display of the "+subsys->checkbox->text()+" sub system");
624 //NB: Dont break here - several systems might share same treetop!
625 // break;
626 }
627 }
628 if (!found) {
629 message("Warning: Found unexpected GeoModel treetop: "+QString(name.c_str()));
630 }
631
632 av.next(); // increment volume cursor.
633 }
634
635 //Hide other cb if not needed:
636 if (!checkBoxOther->isEnabled())
637 checkBoxOther->setVisible(false);
638
639 //Build the geometry for those (available) subsystems that starts out being turned on:
640 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList) {
641 if (!subsys->soswitch||!subsys->checkbox->isChecked())
642 continue;
643 m_d->buildSystem(subsys);
644 //Enable in 3D view:
645 if (subsys->soswitch->whichChild.getValue() != SO_SWITCH_ALL)
646 subsys->soswitch->whichChild = SO_SWITCH_ALL;
647 //Enable in tree browser:
648 m_d->volumetreemodel->enableSubSystem(subsys->flag);
649 // new ModelTest(m_d->volumetreemodel, m_d->treeView_volumebrowser);
650 }
651 if (!m_d->restoredTopvolstates.isEmpty()) {
652 m_d->applyTopVolStates(m_d->restoredTopvolstates,false);
653 m_d->restoredTopvolstates.clear();
654 }
655 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
656 root->enableNotify(save);
657 if (save)
658 root->touch();
659
660
661 if (m_d->controller->autoAdaptMuonChambersToEventData())
663
664 //To ensure we emit it once upon startup:
665 QTimer::singleShot(0, this, SLOT(emit_appropriateMDTProjectionsChanged()));
666}
double length(const pvec &v)
GeoPhysVol * getPhysVol()
Destructor.
static void catchKbdState(void *userData, SoEventCallback *CB)
static bool hasGeoModelExperiment()
static bool debug()
Definition VP1Msg.h:32
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ channel()

IVP1ChannelWidget * IVP1System::channel ( ) const
privateinherited

Definition at line 275 of file IVP1System.cxx.

276{
277 if (VP1Msg::verbose()&&!m_d->channel){
278 messageVerbose("WARNING channel() returning NULL");
279 }
280 assert(m_d->channel);
281 return m_d->channel;
282}
static bool verbose()
Definition VP1Msg.h:31

◆ checkboxChanged

void VP1GeometrySystem::checkboxChanged ( )
protectedslot

Definition at line 774 of file VP1GeometrySystem.cxx.

775{
776 QCheckBox * cb = static_cast<QCheckBox*>(sender());
777 Imp::SubSystemInfo * subsys(0);
778 for (Imp::SubSystemInfo * ss : m_d->subsysInfoList) {
779 if (cb==ss->checkbox) {
780 subsys=ss;
781 break;
782 }
783 }
784 if (!subsys) {
785 message("ERROR: Unknown checkbox");
786 return;
787 }
788
789 SoSwitch * sw = subsys->soswitch;
790 assert(sw);
791 if (cb->isChecked()) {
792 SbBool save = sw->enableNotify(false);
793 if (sw->getNumChildren()==0) {
794 m_d->buildSystem(subsys);
795 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();//
796 }
797 if (sw->whichChild.getValue() != SO_SWITCH_ALL)
798 sw->whichChild = SO_SWITCH_ALL;
799 sw->enableNotify(save);
800 //Enable in tree browser:
801 m_d->volumetreemodel->enableSubSystem(subsys->flag);
802 // new ModelTest(m_d->volumetreemodel, m_d->treeView_volumebrowser);
803 if (save)
804 sw->touch();
805 } else {
806 if (sw->whichChild.getValue() != SO_SWITCH_NONE)
807 sw->whichChild = SO_SWITCH_NONE;
808 m_d->volumetreemodel->disableSubSystem(subsys->flag);
809 }
810}
static Double_t ss

◆ contact_info()

const QString & IVP1System::contact_info ( ) const
inherited

Definition at line 62 of file IVP1System.cxx.

63{
64 return m_d->contact_info;
65}

◆ controllerWidget()

QWidget * IVP1System::controllerWidget ( )
inherited

Definition at line 202 of file IVP1System.cxx.

202 {
203 if (VP1Msg::verbose()) {
204 messageVerbose("controllerWidget()");
205 messageVerbose("registerController m_d->state==ERASED = "+QString(m_d->state==ERASED?"true":"false"));
206 messageVerbose("registerController m_d->state==REFRESHED = "+QString(m_d->state==REFRESHED?"true":"false"));
207 }
208 assert(m_d->state==REFRESHED||m_d->state==ERASED);
209 return m_d->controller;
210 }

◆ create()

void IVP13DSystemSimple::create ( StoreGateSvc * detstore)
privatevirtualinherited

Implements IVP1System.

Definition at line 133 of file IVP13DSystemSimple.cxx.

134{
135 if(VP1Msg::verbose()){
136 messageVerbose("IVP13DSystemSimple create");
137 }
138 assert(!m_d->wasrefreshed);
139 assert(!m_d->wascreated);
140 ensureBuildController();//TODO: Move to refresh.
141 m_d->wascreated=true;
142 m_d->wasrefreshed=false;
143}

◆ deleteController()

void IVP1System::deleteController ( )
privateinherited

Definition at line 213 of file IVP1System.cxx.

214{
215 if (VP1Msg::verbose()){
216 messageVerbose("deleteController()");
217 }
218 if (m_d->controller)
219 m_d->controller->deleteLater();
220 m_d->controller = 0;
221}

◆ deselectAll()

void IVP13DSystem::deselectAll ( SoCooperativeSelection * exception_sel = 0)
virtualinherited

Reimplemented in VP1PrepRawDataSystem.

Definition at line 331 of file IVP13DSystem.cxx.

332{
333 static std::map<SoCooperativeSelection*,IVP13DSystem*>::iterator it, itE = Imp::selection2system.end();
334 for (it = Imp::selection2system.begin(); it!=itE;++it) {
335 if (it->second!=this)
336 continue;
337 if (it->first!=exception_sel) {
338 if (it->first->policy.getValue()!=SoCooperativeSelection::SINGLE) {
339 Imp::start_changeselection(this, it->first);
340 it->first->deselectAll();
341 Imp::finished_changeselection(this, it->first);
342 } else {
343 if (it->first->getList()->getLength()==1) {
344 Imp::start_changeselection(this, it->first);
345 SoPath * path = static_cast<SoPath*>(it->first->getList()->get(0));
346 Imp::made_deselection(it->first,path);
347 it->first->deselectAll();
348 Imp::finished_changeselection(this, it->first);
349 }
350 }
351 }
352 }
353}
static void start_changeselection(void *userdata, SoSelection *sel)
static void finished_changeselection(void *userdata, SoSelection *sel)
static std::map< SoCooperativeSelection *, IVP13DSystem * > selection2system
static void made_deselection(void *userdata, SoPath *path)
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130
path
python interpreter configuration --------------------------------------—
Definition athena.py:128

◆ detectorStore()

StoreGateSvc * IVP1System::detectorStore ( ) const
inherited

Definition at line 318 of file IVP1System.cxx.

319{
321}
static StoreGateSvc * detectorStore()

◆ disallowUpdateGUI()

void IVP1System::disallowUpdateGUI ( )
privateinherited

Definition at line 250 of file IVP1System.cxx.

251{
252 m_d->allowupdategui=false;
253}

◆ emit_appropriateMDTProjectionsChanged

void VP1GeometrySystem::emit_appropriateMDTProjectionsChanged ( )
protectedslot

Definition at line 1591 of file VP1GeometrySystem.cxx.

1592{
1593 if (!m_d->controller) {
1594 message("emit_appropriateMDTProjectionsChanged called before controller built.");
1595 return;
1596 }
1597 VP1GeoFlags::MuonChamberAdaptionStyleFlags f(m_d->controller->muonChamberAdaptionStyle());
1598 bool option_openmdtchambers = f & VP1GeoFlags::OpenMDTChambers;
1599 bool option_hidetubes = f & VP1GeoFlags::HideMDTTubes;
1600 int i (option_openmdtchambers?(option_hidetubes?0:1):2);
1601 if ( m_d->last_appropriatemdtprojections != i ) {
1602 m_d->last_appropriatemdtprojections = i;
1604 }
1605}
void appropriateMDTProjectionsChanged(int)

◆ enableMuonChamberLabels()

void VP1GeometrySystem::enableMuonChamberLabels ( bool t0s,
bool hits )

first is t0s, 2nd is hits

Definition at line 2882 of file VP1GeometrySystem.cxx.

2882 {
2883 m_d->controller->setLabelsEnabled(t0s,hits);
2884}

◆ ensureBuildController()

void IVP13DSystemSimple::ensureBuildController ( )
inherited

Definition at line 90 of file IVP13DSystemSimple.cxx.

91{
92 if (m_d->controllerBuilt)
93 return;
94 m_d->controllerBuilt=true;
95 if(VP1Msg::verbose()){
96 messageVerbose("IVP13DSystemSimple build controller");
97 }
98 QWidget * controller = buildController();
99 if (controller)
100 registerController(controller);
101 if(VP1Msg::verbose()){
102 messageVerbose("IVP13DSystemSimple controller was = "+str(controller));
103 }
104}
virtual QWidget * buildController()
void registerController(QWidget *)

◆ erase()

void IVP13DSystemSimple::erase ( )
privatevirtualinherited

Implements IVP1System.

Definition at line 173 of file IVP13DSystemSimple.cxx.

174{
175 if(VP1Msg::verbose()){
176 messageVerbose("IVP13DSystemSimple::erase() start");
177 }
178 assert(m_d->wascreated);
179 assert(m_d->wasrefreshed);
180
181 bool saveE = m_d->rootE->enableNotify(false);
182
183 systemerase();
184 if(VP1Msg::verbose()){
185 messageVerbose("IVP13DSystemSimple::erase() Removing all event objects from scene");
187 }
188 m_d->rootE->removeAllChildren();
189
190 if (saveE) {
191 m_d->rootE->enableNotify(true);
192 m_d->rootE->touch();
193 }
194
195 m_d->wasrefreshed=false;
196 if(VP1Msg::verbose()){
197 messageVerbose("IVP13DSystemSimple::erase() end");
198 }
199}
void warnOnDisabledNotifications() const

◆ eventStore()

StoreGateSvc * IVP1System::eventStore ( ) const
inherited

Definition at line 312 of file IVP1System.cxx.

313{
315}
static StoreGateSvc * eventStore()

◆ getCameraList()

std::set< SoCamera * > IVP13DSystem::getCameraList ( )
inherited

Definition at line 395 of file IVP13DSystem.cxx.

396{
397 std::set<SoCamera*> cameralist = m_d->staticcameras;
398 std::set<SoQtViewer*>::const_iterator it, itE=m_d->viewers.end();
399 for (it=m_d->viewers.begin();it!=itE;++it) {
400 SoCamera*cam = (*it)->getCamera();
401 if (cam)
402 cameralist.insert(cam);
403 }
404
405 //m_d->camerasfromviewer
406 return cameralist;
407}

◆ getSceneGraph()

SoSeparator * IVP13DSystemSimple::getSceneGraph ( ) const
privatevirtualinherited

Implements IVP13DSystem.

Definition at line 127 of file IVP13DSystemSimple.cxx.

128{
129 return static_cast<SoSeparator*>(m_d->root);
130}

◆ inactiveSystemTurnedActive

void IVP1System::inactiveSystemTurnedActive ( )
signalinherited

◆ information()

const QString & IVP1System::information ( ) const
inherited

Definition at line 56 of file IVP1System.cxx.

57{
58 return m_d->information;
59}

◆ isRefreshing()

bool IVP1System::isRefreshing ( )
privateinherited

Definition at line 108 of file IVP1System.cxx.

109{
110 return m_d->refreshing;
111}

◆ itemFromSystemSelected

void IVP13DSystem::itemFromSystemSelected ( )
signalinherited

◆ loadMaterialsFromFile

void VP1GeometrySystem::loadMaterialsFromFile ( const QString & filename)
protectedslot

Definition at line 2808 of file VP1GeometrySystem.cxx.

2809{
2810 if (filename.isEmpty())
2811 return;
2812 QFileInfo fi(filename);
2813 if (!fi.exists()) {
2814 QMessageBox::critical(0, "Error - file does not exists: "+filename,
2815 "File does not exists: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2816 return;
2817 }
2818 if (!fi.isReadable()) {
2819 QMessageBox::critical(0, "Error - file is not readable: "+filename,
2820 "File is not readable: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2821 return;
2822 }
2823 //open file
2824 QFile file(filename);
2825 if (!file.open(QIODevice::ReadOnly)) {
2826 QMessageBox::critical(0, "Error - problems opening file "+filename,
2827 "Problems opening file: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2828 return;
2829 }
2830 QByteArray byteArray64;
2831 QDataStream infile(&file);
2832 infile >> byteArray64;
2833 QByteArray byteArray = qUncompress(QByteArray::fromBase64(byteArray64));
2834
2835 VP1Deserialise s(byteArray,this);
2836 if (s.version()!=0) {
2837 QMessageBox::critical(0, "Error - File in wrong format "+filename,
2838 "File in wrong format: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2839 return;
2840 }
2841 QString txtbegin, txtend;
2842 QByteArray baDet, baMat, baVol;
2843 txtbegin = s.restoreString();
2844 baDet = s.restoreByteArray();
2845 baMat = s.restoreByteArray();
2846 baVol = s.restoreByteArray();
2847 txtend = s.restoreString();
2848 s.disableUnrestoredChecks();
2849 if (txtbegin!="VP1GeoMaterialsBegin"||txtend!="VP1GeoMaterialsEnd") {
2850 QMessageBox::critical(0, "Error - File in wrong format "+filename,
2851 "File in wrong format: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2852 return;
2853 }
2854
2855 m_d->ensureInitVisAttributes();
2856 m_d->detVisAttributes->applyState(baDet);
2857 m_d->matVisAttributes->applyState(baMat);
2858 m_d->volVisAttributes->applyState(baVol);
2859
2860 VolumeHandle* lastsel = m_d->controller->lastSelectedVolume();
2861 m_d->controller->setLastSelectedVolume(0);
2862 m_d->controller->setLastSelectedVolume(lastsel);
2863}
str infile
Definition run.py:13
TFile * file

◆ message() [1/3]

void IVP1System::message ( const QString & str) const
inherited

Definition at line 336 of file IVP1System.cxx.

337{
338 if (receivers(SIGNAL(sysmessage(QString))) > 0){
340 }
341 else{
342 std::cout<<VP1Msg::prefix_msg()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
343 }
344}
void sysmessage(QString) const
static const char * prefix_msg()
Definition VP1Msg.h:56

◆ message() [2/3]

void IVP1System::message ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 400 of file IVP1System.cxx.

401{
402 if (addtostart.isEmpty()) {
403 message(l,addtoend);
404 return;
405 }
406 if (addtoend.isEmpty()) {
407 for (const QString& s : l)
408 message(addtostart+s);
409 } else {
410 for (const QString& s : l)
411 message(addtostart+s+addtoend);
412 }
413}

◆ message() [3/3]

void IVP1System::message ( const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 362 of file IVP1System.cxx.

363{
364 if (addtoend.isEmpty()) {
365 for (const QString& s : l)
366 message(s);
367 } else {
368 for (const QString& s : l)
369 message(s+addtoend);
370 }
371}

◆ messageDebug() [1/3]

void IVP1System::messageDebug ( const QString & str) const
inherited

Definition at line 347 of file IVP1System.cxx.

348{
349 if (VP1Msg::debug())
350 std::cout<<VP1Msg::prefix_debug()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
351}
static const char * prefix_debug()
Definition VP1Msg.h:57

◆ messageDebug() [2/3]

void IVP1System::messageDebug ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 416 of file IVP1System.cxx.

417{
418 if (addtostart.isEmpty()) {
419 messageDebug(l,addtoend);
420 return;
421 }
422 if (addtoend.isEmpty()) {
423 for (const QString& s : l)
424 messageDebug(addtostart+s);
425 } else {
426 for (const QString& s : l)
427 messageDebug(addtostart+s+addtoend);
428 }
429}
void messageDebug(const QString &) const

◆ messageDebug() [3/3]

void IVP1System::messageDebug ( const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 374 of file IVP1System.cxx.

375{
376 if (addtoend.isEmpty()) {
377 for (const QString& s : l)
378 messageDebug(s);
379 } else {
380 for (const QString& s : l)
381 messageDebug(s+addtoend);
382 }
383}

◆ messageVerbose() [1/3]

void IVP1System::messageVerbose ( const QString & str) const
inherited

Definition at line 354 of file IVP1System.cxx.

355{
356 if (VP1Msg::verbose())
357 std::cout<<VP1Msg::prefix_verbose()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
358}
static const char * prefix_verbose()
Definition VP1Msg.h:59

◆ messageVerbose() [2/3]

void IVP1System::messageVerbose ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 432 of file IVP1System.cxx.

433{
434 if (!VP1Msg::verbose())
435 return;
436 if (addtostart.isEmpty()) {
437 messageVerbose(l,addtoend);
438 return;
439 }
440 if (addtoend.isEmpty()) {
441 for (const QString& s : l)
442 messageVerbose(addtostart+s);
443 } else {
444 for (const QString& s : l)
445 messageVerbose(addtostart+s+addtoend);
446 }
447}

◆ messageVerbose() [3/3]

void IVP1System::messageVerbose ( const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 386 of file IVP1System.cxx.

387{
388 if (!VP1Msg::verbose())
389 return;
390 if (addtoend.isEmpty()) {
391 for (const QString& s : l)
393 } else {
394 for (const QString& s : l)
395 messageVerbose(s+addtoend);
396 }
397}

◆ muonChamberT0sChanged

void VP1GeometrySystem::muonChamberT0sChanged ( const std::map< GeoPVConstLink, float > & t0s,
int index )
slot

The map is the dt0 per chamber, plus a label identifier, which by convention (!) is 0=Moore, 1=Muonboy.

Definition at line 2886 of file VP1GeometrySystem.cxx.

2886 {
2887 messageVerbose("muonChamberT0sChanged for this many chambers:"+str(t0s.size()));
2888 if (index>=m_d->chamberT0s.size())
2889 message("ERROR: chamber t0 index out of bounds!");
2890 else
2891 m_d->chamberT0s[index]=&t0s;
2892}
str index
Definition DeMoScan.py:362

◆ name()

const QString & IVP1System::name ( ) const
inherited

Definition at line 50 of file IVP1System.cxx.

51{
52 return m_d->name;
53}

◆ needErase

void IVP1System::needErase ( )
signalinherited

◆ orientViewToMuonChamber

void VP1GeometrySystem::orientViewToMuonChamber ( const GeoPVConstLink & chamberPV)
slot

Definition at line 1767 of file VP1GeometrySystem.cxx.

1768{
1769 if (!m_d->sceneroot)
1770 return;
1771
1772 //Find relevant muon subsystem info:
1773 Imp::SubSystemInfo * subsys = m_d->chamberPVToMuonSubSystemInfo(chamberPV);
1774 if (!subsys) {
1775 message("Error: Asked to orient view to chamber volume '"
1776 +QString(chamberPV->getLogVol()->getName().c_str())
1777 +"', which doesn't fit the known format of any chamber!");
1778 return;
1779 }
1780
1781 //Subsystem must be available:
1782 if (!subsys->soswitch) {//NB: Could as well look at checkbox enabled state instead of whether sw pointer is null.
1783 message("Warning: Asked to orient view to muon chamber volume which is not available. Perhaps muon geometry was not built?");
1784 return;
1785 }
1786
1787 //Find handle for the muon chamber (possibly ensure that relevant muon subsystem is build):
1788 std::map<PVConstLink,VolumeHandle*>::iterator itChamber = m_d->muonchambers_pv2handles.find(chamberPV);
1789 if (itChamber==m_d->muonchambers_pv2handles.end()) {
1790 //Probably the muon relevant muon system was not initialised. Build and try again:
1791 m_d->buildSystem(subsys);
1792 itChamber = m_d->muonchambers_pv2handles.find(chamberPV);
1793 if (itChamber==m_d->muonchambers_pv2handles.end()) {
1794 message("Error: Asked to orient view to chamber volume '"
1795 +QString(chamberPV->getLogVol()->getName().c_str())
1796 +"', but could not find chamber handle!");
1797 return;
1798 }
1799 }
1800 VolumeHandle * chamberHandle = itChamber->second;
1801
1802 //Figure out if we are MDT, CSC or TGC (if not we print warning and abort);
1803
1804 std::string name = chamberHandle->getNameStdString();
1805
1806 bool isCSCOrTGC = name.size()>=2 && ( (name[0]=='C' && name[1]=='S') || (name[0]=='T') );
1807 if (!isCSCOrTGC&&!(name.size()>=1&&(name[0]=='E'||name[0]=='B'))) {
1808 //Neither CSC, TGC or MDT:
1809 message("orientViewToMuonChamber Warning: Not CSC, TGC or MDT station!");
1810 return;
1811 }
1812
1813 bool save = subsys->soswitch->enableNotify(false);//Disable notifications to avoid chamber flickering in for a moment.
1814
1815 //If subsystem soswitch is turned off, we turn it on temporarily
1816 int32_t soswitch_val = subsys->soswitch->whichChild.getValue();
1817 if (soswitch_val!=SO_SWITCH_ALL)
1818 subsys->soswitch->whichChild = SO_SWITCH_ALL;
1819
1820 VP1GeoFlags::VOLSTATE oldChamberState = chamberHandle->state();
1821 chamberHandle->setState(VP1GeoFlags::CONTRACTED);
1822
1823 SoSeparator * chambersep = chamberHandle->nodeSoSeparator();
1824 if (chambersep) {
1825 std::set<SoCamera*> cameras = getCameraList();
1826 std::set<SoCamera*>::iterator it,itE = cameras.end();
1827 for (it=cameras.begin();it!=itE;++it) {
1828 //Find desired camera orientation (must be parallel to tubes - and
1829 //we choose the one of the possible orientations which is closest to
1830 //current camera orientation - i.e. loop over tubes and try both
1831 //positive and negative directions of each tube.
1832
1833 SbRotation camrot = (*it)->orientation.getValue();
1834 SbVec3f cameraDir(0, 0, -1); // init to default view direction vector
1835 camrot.multVec(cameraDir, cameraDir);
1836 SbVec3f cameraUpVec(0, 1, 0); // init to default up vector
1837 camrot.multVec(cameraUpVec, cameraUpVec);
1838
1839 std::pair<SbVec3f,SbVec3f> chamberdirections;
1840 if (isCSCOrTGC) {
1841 //CSC/TGC chamber - look at top TRD shape for directions
1842 chamberdirections = m_d->getClosestCSCOrTGCEdgeDirections(cameraDir,chamberHandle);
1843 } else {
1844 //MDT chamber - look at tubes for direction
1845 chamberdirections = m_d->getClosestMuonDriftTubeDirections(cameraDir,cameraUpVec,chamberHandle);
1846 }
1847 SbVec3f newdirection = - chamberdirections.first;
1848 SbVec3f newup(cameraUpVec);
1849 const float epsilon(0.00001f);
1850 if (m_d->previousAlignedChamberHandle==chamberHandle&&cameraDir.equals(newdirection,epsilon)) {
1851 //If we already zoomed in the direction of the chamber,
1852 //subsequent requests aligns the upvector along the other chamber
1853 //axes.
1854 SbRotation rot(cameraDir,0.5*M_PI);
1855 SbVec3f chambdir1 = chamberdirections.second;
1856 SbVec3f chambdir2,chambdir3,chambdir4;
1857 rot.multVec(chambdir1,chambdir2);
1858 rot.multVec(chambdir2,chambdir3);
1859 rot.multVec(chambdir3,chambdir4);
1860 if (cameraUpVec.equals(chambdir1,epsilon)) {
1861 newup = chambdir2;
1862 } else if (cameraUpVec.equals(chambdir2,epsilon)) {
1863 newup = chambdir3;
1864 } else if (cameraUpVec.equals(chambdir3,epsilon)) {
1865 newup = chambdir4;
1866 } else if (cameraUpVec.equals(chambdir4,epsilon)) {
1867 newup = chambdir1;
1868 } else {
1869 //Take the closest one...
1870 float cos1 = chambdir1.dot(cameraUpVec);
1871 float cos2 = chambdir2.dot(cameraUpVec);
1872 float cos3 = chambdir3.dot(cameraUpVec);
1873 float cos4 = chambdir4.dot(cameraUpVec);
1874 float maxcos = std::max(std::max(cos1,cos2),std::max(cos3,cos4));
1875 if (cos1==maxcos)
1876 newup = chambdir1;
1877 else if (cos2==maxcos)
1878 newup = chambdir2;
1879 else if (cos3==maxcos)
1880 newup = chambdir3;
1881 else
1882 newup = chambdir4;
1883 }
1884 }
1885
1886 //Zoom to chamber with given orientation - and we make sure the
1887 //chamber is attached while we initiate the zoom (so the camera
1888 //helper can use a boundaryboxaction to find the bounding box):
1889 VP1CameraHelper::animatedZoomToSubTree(*it,m_d->sceneroot,chambersep,1.0, 100.0, 100.0, 1.0,newdirection,newup);
1890 }
1891 }
1892
1893 chamberHandle->setState(oldChamberState);
1894 if (soswitch_val!=SO_SWITCH_ALL)
1895 subsys->soswitch->whichChild.setValue(soswitch_val);
1896 if (save) {
1897 subsys->soswitch->enableNotify(true);
1898 subsys->soswitch->touch();
1899 }
1900 m_d->previousAlignedChamberHandle=chamberHandle;
1901
1902}
#define M_PI
CamList getCameraList()
static VP1CameraHelper * animatedZoomToSubTree(SoCamera *camera, SoGroup *sceneroot, SoNode *subtreeroot, double duration_in_secs=1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999), bool varySpeed=true, bool forceCircular=false)
void setState(const VP1GeoFlags::VOLSTATE &state)
std::string getNameStdString() const
VP1GeoFlags::VOLSTATE state() const
SoSeparator * nodeSoSeparator() const

◆ plotSpectrum

void VP1GeometrySystem::plotSpectrum ( QStack< QString > & ,
int copyNumber = -1 )
signal

◆ refresh()

void IVP13DSystemSimple::refresh ( StoreGateSvc * storegate)
privatevirtualinherited

Implements IVP1System.

Definition at line 146 of file IVP13DSystemSimple.cxx.

147{
148 assert(m_d->wascreated);
149 assert(!m_d->wasrefreshed);
150
151 if (m_d->first) {
152 if(VP1Msg::verbose()){
153 messageVerbose("IVP13DSystemSimple first refresh - so calling create methods (i.e. delayed create).");
154 }
156 m_d->first = false;
157 m_d->root->removeChild(m_d->rootR);
159 m_d->root->addChild(m_d->rootR);
160 }
161
162 m_d->root->removeChild(m_d->rootE);
163 updateGUI();
164 buildEventSceneGraph(sg, m_d->rootE);
165 updateGUI();
166 m_d->root->addChild(m_d->rootE);
167
168 m_d->wasrefreshed=true;
169
170}
virtual void systemcreate(StoreGateSvc *detstore)
virtual void buildPermanentSceneGraph(StoreGateSvc *detstore, SoSeparator *root)
virtual void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)=0
StoreGateSvc * detectorStore() const

◆ registerCamera()

void IVP13DSystem::registerCamera ( SoCamera * camera)
inherited

Definition at line 410 of file IVP13DSystem.cxx.

410 {
411 if (!cam)
412 return;
413 m_d->staticcameras.insert(cam);
414 cam->ref();
415}

◆ registerController()

void IVP1System::registerController ( QWidget * w)
protectedinherited

Definition at line 224 of file IVP1System.cxx.

225{
226 if (VP1Msg::verbose()) {
227 messageVerbose("registerController ");
228 messageVerbose("registerController m_d->canregistercontroller = "+QString(m_d->canregistercontroller?"true":"false"));
229 messageVerbose("registerController m_d->state==CONSTRUCTED = "+QString(m_d->state==CONSTRUCTED?"true":"false"));
230 messageVerbose("registerController m_d->controller==0 = "+QString(m_d->controller==0?"true":"false"));
231 messageVerbose("registerController w!=0 = "+QString(w!=0?"true":"false"));
232 }
233 if (!m_d->canregistercontroller)
234 message("ERROR: Please don't register controllers after create().");
235 if (m_d->state!=CONSTRUCTED)
236 message("ERROR: Please only register controllers in CONSTRUCTED state.");
237 if (!w) {
238 message("ERROR: Attempt to register null controller.");
239 return;
240 }
241 if (m_d->controller) {
242 message("ERROR: Attempt to register controller twice.");
243 return;
244 }
245 m_d->controller = w;
246 w->setParent(0);
247}

◆ registerSelectionNode()

void IVP13DSystem::registerSelectionNode ( SoCooperativeSelection * selection)
inherited

Definition at line 257 of file IVP13DSystem.cxx.

258{
259 if (!selection) {
260 message("registerSelectionNode Error: NULL selection pointer!");
261 return;
262 }
264 message("registerSelectionNode Error: Trying to register selection node more than once!");
265 return;
266 }
267
268 selection->addSelectionCallback( Imp::made_selection, selection );
269 selection->addDeselectionCallback( Imp::made_deselection, selection );
270 selection->addStartCallback( Imp::start_changeselection, this );
271 selection->addFinishCallback( Imp::finished_changeselection, this );
272 selection->addClickOutsideCallback( Imp::clickedoutside, this );
273
275 selection->ref();
276
277 messageVerbose("selection node registered");
278}
static void clickedoutside(void *userdata, SoCooperativeSelection *sel)
static void made_selection(void *userdata, SoPath *path)
const std::string selection
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138

◆ registerViewer()

void IVP13DSystem::registerViewer ( SoQtViewer * viewer)
inherited

Definition at line 418 of file IVP13DSystem.cxx.

419{
420 if (!viewer)
421 return;
422 m_d->viewers.insert(viewer);
423}

◆ reiconizeToShowSpecificMuonChambers

void VP1GeometrySystem::reiconizeToShowSpecificMuonChambers ( const std::set< GeoPVConstLink > & chambers)
slot

Definition at line 1608 of file VP1GeometrySystem.cxx.

1609{
1610 //Update map of touched chamber lists:
1611 bool listChanged(m_d->sender2ChamberList.find(sender())!=m_d->sender2ChamberList.end()?
1612 (chambers != m_d->sender2ChamberList[sender()]):true);
1613 m_d->sender2ChamberList[sender()] = chambers;
1614
1615 //Trigger update if list changed and in auto mode:
1616 if ( listChanged && m_d->controller->autoAdaptMuonChambersToEventData() )
1618}

◆ resetSubSystems

void VP1GeometrySystem::resetSubSystems ( VP1GeoFlags::SubSystemFlags f)
protectedslot

Definition at line 1517 of file VP1GeometrySystem.cxx.

1518{
1519 if (!f) {
1520 return;
1521 }
1522
1523 deselectAll();
1524 for (Imp::SubSystemInfo*si : m_d->subsysInfoList) {
1525 if (si->flag & f) {
1526 if (!si->isbuilt) {
1527 continue;
1528 }
1529 VolumeHandle::VolumeHandleListItr it(si->vollist.begin()),itE(si->vollist.end());
1530 for (;it!=itE;++it) {
1531 messageDebug("resetting volume --> " + (*it)->getName() );
1532 (*it)->reset();
1533 }
1534 }
1535 }
1536}

◆ restoreFromState()

void VP1GeometrySystem::restoreFromState ( QByteArray ba)
virtual

Reimplemented from IVP1System.

Definition at line 1336 of file VP1GeometrySystem.cxx.

1336 {
1337 VP1Deserialise state(ba,this);
1338 if (state.version()<0||state.version()>7) {
1339 message("Warning: State data in .vp1 file is in wrong format - ignoring!");
1340 return;
1341 }
1342 if (state.version()<=5) {
1343 message("Warning: State data in .vp1 file is in obsolete format - ignoring!");
1344 return;
1345 }
1346
1348 IVP13DSystemSimple::restoreFromState(state.restoreByteArray());
1349
1350 //Controller:
1351 m_d->controller->restoreSettings(state.restoreByteArray());
1352
1353 //Subsystem checkboxes:
1354 VP1GeoFlags::SubSystemFlags flags;
1355 QMap<QString,bool> subsysstate = state.restore<QMap<QString,bool> >();
1356 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList) {
1357 state.widgetHandled(subsys->checkbox);
1358 if (subsysstate.contains(subsys->checkbox->text())&&subsysstate[subsys->checkbox->text()])
1359 flags |= subsys->flag;
1360 }
1361 m_d->initialSubSystemsTurnedOn = flags;
1362
1363 //Volume states:
1364 QMap<quint32,QByteArray> topvolstates;
1365 topvolstates = state.restore<QMap<quint32,QByteArray> >();
1366 if (m_d->sceneroot)//(for some reason) we already have been in buildPermanentScenegraph
1367 m_d->applyTopVolStates(topvolstates,true);
1368 else
1369 m_d->restoredTopvolstates = topvolstates;//save until buildPermanentScenegraph
1370
1371 if (state.version()>=7) {
1372 m_d->ensureInitVisAttributes();
1373 m_d->detVisAttributes->applyState(state.restoreByteArray());
1374 m_d->matVisAttributes->applyState(state.restoreByteArray());
1375 m_d->volVisAttributes->applyState(state.restoreByteArray());
1376 }
1377
1378 state.disableUnrestoredChecks();//We do the testing in the controller
1379
1380 //Special:
1381 if (m_d->controller->autoAdaptMuonChambersToEventData())
1383}
virtual void restoreFromState(QByteArray)
State state() const

◆ saveMaterialsToFile

void VP1GeometrySystem::saveMaterialsToFile ( const QString & filename,
bool onlyChangedMaterials )
protectedslot

Definition at line 2769 of file VP1GeometrySystem.cxx.

2770{
2771 if (filename.isEmpty())
2772 return;
2773
2774 //If file exists, ask to overwrite.
2775 QFileInfo fi(filename);
2776 if (fi.exists()) {
2777 if (!fi.isWritable()) {
2778 QMessageBox::critical(0, "Error - could not save to file "+filename,
2779 "Could not save to file: <i>"+filename+"</i>"
2780 +"<br/><br/>Reason: File exists already and is write protected",QMessageBox::Ok,QMessageBox::Ok);
2781 return;
2782 }
2783 }
2784
2785 QFile file(filename);
2786 if (!file.open(QIODevice::WriteOnly)) {
2787 QMessageBox::critical(0, "Error - problems writing to file "+filename,
2788 "Problems writing to file: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2789 return;
2790 }
2791
2792 m_d->ensureInitVisAttributes();
2793 VP1Serialise s(0/*version*/,this);
2794 //Save some file ID info!!
2795 s.save(QString("VP1GeoMaterialsBegin"));
2796 s.save(m_d->detVisAttributes->getState(onlyChangedMaterials));
2797 s.save(m_d->matVisAttributes->getState(onlyChangedMaterials));
2798 s.save(m_d->volVisAttributes->getState(onlyChangedMaterials));
2799 s.save(QString("VP1GeoMaterialsEnd"));
2800 s.disableUnsavedChecks();
2801
2802 QDataStream outfile(&file);
2803 outfile<<qCompress(s.result()).toBase64();
2804
2805}

◆ saveState()

QByteArray VP1GeometrySystem::saveState ( )
virtual

Reimplemented from IVP1System.

Definition at line 1297 of file VP1GeometrySystem.cxx.

1297 {
1298
1300
1301 VP1Serialise serialise(7/*version*/,this);
1303
1304 //Controller:
1305 serialise.save(m_d->controller->saveSettings());
1306
1307 //Subsystem checkboxes:
1308 QMap<QString,bool> subsysstate;
1309 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList) {
1310 serialise.widgetHandled(subsys->checkbox);
1311 subsysstate.insert(subsys->checkbox->text(),subsys->checkbox->isChecked());
1312 }
1313 serialise.save(subsysstate);
1314
1315 //Volume states:
1316 QMap<quint32,QByteArray> topvolstates;
1317 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList) {
1318 if (m_d->controller->autoAdaptMuonChambersToEventData()&&subsys->hasMuonChambers())
1319 continue;//No need to store muon chamber data which will anyway be auto-adapted away.
1320 VolumeHandle::VolumeHandleListItr it(subsys->vollist.begin()),itE(subsys->vollist.end());
1321 for (;it!=itE;++it)
1322 topvolstates.insert((*it)->hashID(),(*it)->getPersistifiableState());
1323 }
1324 serialise.save(topvolstates);
1325
1326 m_d->ensureInitVisAttributes();
1327 serialise.save(m_d->detVisAttributes->getState());//version 7+
1328 serialise.save(m_d->matVisAttributes->getState());//version 7+
1329 serialise.save(m_d->volVisAttributes->getState());//version 7+
1330
1331 serialise.disableUnsavedChecks();//We do the testing in the controller
1332 return serialise.result();
1333}
virtual QByteArray saveState()
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors

◆ serviceLocator()

ISvcLocator * IVP1System::serviceLocator ( ) const
inherited

Definition at line 324 of file IVP1System.cxx.

325{
327}
static ISvcLocator * serviceLocator()

◆ setActiveState()

void IVP1System::setActiveState ( const ActiveState & s,
const bool & donttriggererase = true )
privateinherited

Definition at line 162 of file IVP1System.cxx.

163{
164 //First handle case where we dont actually change state. Only
165 //special consideration is OFF->OFF where we have to do something if
166 //we need to erase:
167 if (m_d->activeState==OFF&&s==OFF&&(m_d->state==REFRESHED||m_d->refreshing)&&!donttriggererase) {
168 needErase();
169 m_d->channel->emitRefreshInfoChanged();
170 return;
171 } else if (m_d->activeState==s) {
172 m_d->channel->emitRefreshInfoChanged();
173 return;
174 }
175
176 //Ok, we know that we are either ON->OFF or OFF->ON.
177 m_d->activeState = s;
178
179 if (s==ON) {
180 //OFF->ON: We might need a refresh, so send out a signal for the scheduler:
182 } else {
183 //ON->OFF: We might need an erase signal:
184 if ((m_d->state==REFRESHED||m_d->refreshing)&&!donttriggererase) {
185 needErase();
186 }
187 }
188 m_d->channel->emitRefreshInfoChanged();
189}
void inactiveSystemTurnedActive()
void needErase()

◆ setAutoAdaptMuonChambersToEventData()

void VP1GeometrySystem::setAutoAdaptMuonChambersToEventData ( bool b)

Definition at line 354 of file VP1GeometrySystem.cxx.

355{
357 if (m_d->controller->autoAdaptMuonChambersToEventData()!=b) {
358 m_d->controller->setAutoAdaptMuonChambersToEventData(b);
359 if (b)
361 }
362}

◆ setCanRegisterController()

void IVP1System::setCanRegisterController ( const bool & c)
privateinherited

Definition at line 285 of file IVP1System.cxx.

286{
287 if (VP1Msg::verbose()){
288 messageVerbose("setCanRegisterController called with"+QString(c?"true":"false"));
289 }
290 m_d->canregistercontroller=c;
291}

◆ setChannel()

void IVP1System::setChannel ( IVP1ChannelWidget * cw)
privateinherited

Definition at line 94 of file IVP1System.cxx.

95{
96 if (VP1Msg::verbose()) {
97 messageVerbose("setChannel ");
98 messageVerbose("setChannel m_d->state==CONSTRUCTED = "+QString(m_d->state==CONSTRUCTED?"true":"false"));
99 messageVerbose("setChannel cw!=0 = "+QString(cw!=0?"true":"false"));
100 }
101 assert(!m_d->channel);
102 assert(cw);
103 assert(m_d->state==CONSTRUCTED);
104 m_d->channel = cw;
105}

◆ setCurvedSurfaceRealism

void VP1GeometrySystem::setCurvedSurfaceRealism ( int val)
slot

Definition at line 1488 of file VP1GeometrySystem.cxx.

1489{
1491 if (val<0||val>100) {
1492 message("setCurvedSurfaceRealism Error: Value "+str(val)+"out of range!");
1493 return;
1494 }
1495 m_d->controller->setComplexity(val==100?1.0:(val==0?0.0:val/100.0));
1496}

◆ setGeometrySelectable()

void VP1GeometrySystem::setGeometrySelectable ( bool b)

Definition at line 335 of file VP1GeometrySystem.cxx.

335 {
337 m_d->controller->setGeometrySelectable(b);
338}

◆ setLabelPosOffsets

void VP1GeometrySystem::setLabelPosOffsets ( const QList< int > & )
protectedslot

Definition at line 2866 of file VP1GeometrySystem.cxx.

2867{
2868 messageVerbose("setLabelPosOffsets called");
2869 setLabels(m_d->controller->labels());
2870}

◆ setLabels

void VP1GeometrySystem::setLabels ( int i)
protectedslot

Definition at line 2872 of file VP1GeometrySystem.cxx.

2872 {
2873 messageVerbose("setLabels "+str(i)+" for this many chambers:"+str(m_d->muonchambers_pv2handles.size()));
2874 // loop over all contained volumes (all visible volumes?) and update labels.
2875 // Just muons to start with
2876 std::map<PVConstLink,VolumeHandle*>::const_iterator it = m_d->muonchambers_pv2handles.begin(), itEnd = m_d->muonchambers_pv2handles.end();
2877 for (; it!=itEnd ; ++it){
2878 if (it->second->isInMuonChamber()) it->second->updateLabels(); // currently only do labels for Muon volumes
2879 }
2880}

◆ setOrientViewToMuonChambersOnClick()

void VP1GeometrySystem::setOrientViewToMuonChambersOnClick ( bool b)

Definition at line 347 of file VP1GeometrySystem.cxx.

348{
350 m_d->controller->setOrientViewToMuonChambersOnClick(b);
351}

◆ setRefreshing()

void IVP1System::setRefreshing ( const bool & b)
privateinherited

Definition at line 114 of file IVP1System.cxx.

115{
116 if (VP1Msg::verbose()){
117 messageVerbose("setRefreshing() called with b="+QString(b?"true":"false"));
118 }
119 if (b) {
120 assert(m_d->state==ERASED);
121 } else {
122 assert(m_d->state==REFRESHED);
123 }
124 m_d->refreshing = b;
125}

◆ setShowVolumeOutLines

void VP1GeometrySystem::setShowVolumeOutLines ( bool b)
protectedslot

Definition at line 2760 of file VP1GeometrySystem.cxx.

2761{
2762 std::map<SoSeparator*,VolumeHandle*>::iterator it,itE(m_d->sonodesep2volhandle.end());
2763 for (it =m_d->sonodesep2volhandle.begin();it!=itE;++it)
2765}
static void setShowVolumeOutlines(SoGroup *nodesep, bool showvol)

◆ setState()

void IVP1System::setState ( const State & s)
privateinherited

Definition at line 141 of file IVP1System.cxx.

142{
143#ifndef NDEBUG
144 assert (m_d->state != s);
145 assert(s!=CONSTRUCTED);
146 if (s==REFRESHED) {
147 assert(m_d->state==ERASED);
148 }
149 if (s==ERASED) {
150 assert(m_d->state==REFRESHED||m_d->state==CONSTRUCTED);
151 }
152 if (s==UNCREATED) {
153 assert(m_d->state==ERASED);
154 }
155#endif
156 m_d->state = s;
157 if (s==REFRESHED||s==ERASED)
158 m_d->channel->emitRefreshInfoChanged();
159}

◆ setUserSelectionNotificationsEnabled()

void IVP13DSystem::setUserSelectionNotificationsEnabled ( SoCooperativeSelection * sel,
bool enabled )
inherited

Definition at line 310 of file IVP13DSystem.cxx.

311{
312 if (!selection) {
313 message("setUserSelectionNotificationsEnabled Error: NULL selection pointer!");
314 return;
315 }
317 message("setUserSelectionNotificationsEnabled Error: Called for selection which was never registered!");
318 return;
319 }
320 if (enabled != m_d->selectionsWithDisabledNotifications.contains(selection))
321 return;
322
323 if (enabled)
324 m_d->selectionsWithDisabledNotifications.remove(selection);
325 else
326 m_d->selectionsWithDisabledNotifications << selection;
327
328}

◆ setZoomToVolumeOnClick()

void VP1GeometrySystem::setZoomToVolumeOnClick ( bool b)

Definition at line 341 of file VP1GeometrySystem.cxx.

341 {
343 m_d->controller->setZoomToVolumeOnClick(b);
344}

◆ state()

IVP1System::State IVP1System::state ( ) const
inherited

Definition at line 129 of file IVP1System.cxx.

130{
131 return m_d->state;
132}

◆ storeGate()

StoreGateSvc * IVP1System::storeGate ( ) const
inlineinherited

Definition at line 119 of file IVP1System.h.

119{ return eventStore(); }//OBSOLETE NAME. Use eventStore() instead.
StoreGateSvc * eventStore() const

◆ str() [1/30]

QString VP1String::str ( const Amg::Vector3D & t)
inlinestaticinherited

Definition at line 98 of file VP1String.h.

98{ return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [2/30]

QString VP1String::str ( const bool b)
inlinestaticinherited

Definition at line 53 of file VP1String.h.

53{ return b?"True":"False"; }

◆ str() [3/30]

QString VP1String::str ( const char * c)
inlinestaticinherited

Definition at line 50 of file VP1String.h.

50{ return c; }

◆ str() [4/30]

QString VP1String::str ( const double & d)
inlinestaticinherited

Definition at line 81 of file VP1String.h.

81{ return QString::number(d); }

◆ str() [5/30]

QString VP1String::str ( const float & f)
inlinestaticinherited

Definition at line 82 of file VP1String.h.

82{ return QString::number(f); }

◆ str() [6/30]

template<class T>
QString VP1String::str ( const HepGeom::BasicVector3D< T > & t)
inlinestaticinherited

Definition at line 95 of file VP1String.h.

95{ return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [7/30]

QString VP1String::str ( const QColor & c)
staticinherited

Definition at line 30 of file VP1String.cxx.

31{
32 return c.isValid() ? c.name() : "Invalid";
33}

◆ str() [8/30]

template<class T>
QString VP1String::str ( const QFlags< T > & f)
inlinestaticinherited

Definition at line 91 of file VP1String.h.

91{ return "0x"+QString::number(f, 16).toUpper().rightJustified(8,'0'); }

◆ str() [9/30]

template<class T>
QString VP1String::str ( const QList< T > & t)
inlinestaticinherited

Definition at line 102 of file VP1String.h.

102{ return "QList of size"+QString::number(t.size()); }

◆ str() [10/30]

QString VP1String::str ( const QString & s)
inlinestaticinherited

Definition at line 49 of file VP1String.h.

49{ return s; }

◆ str() [11/30]

QString VP1String::str ( const SbColor & c)
staticinherited

Definition at line 36 of file VP1String.cxx.

37{
39}
static QColor sbcol2qcol(const SbColor &)

◆ str() [12/30]

QString VP1String::str ( const SbVec2d & v)
staticinherited

Definition at line 61 of file VP1String.cxx.

61{ double x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }
#define y
#define x

◆ str() [13/30]

QString VP1String::str ( const SbVec2f & v)
staticinherited

Definition at line 62 of file VP1String.cxx.

62{ float x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [14/30]

QString VP1String::str ( const SbVec2s & v)
staticinherited

Definition at line 63 of file VP1String.cxx.

63{ short x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [15/30]

QString VP1String::str ( const SbVec3d & v)
staticinherited

Definition at line 64 of file VP1String.cxx.

64{ double x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }
#define z

◆ str() [16/30]

QString VP1String::str ( const SbVec3f & v)
staticinherited

Definition at line 65 of file VP1String.cxx.

65{ float x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [17/30]

QString VP1String::str ( const SbVec3s & v)
staticinherited

Definition at line 66 of file VP1String.cxx.

66{ short x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [18/30]

QString VP1String::str ( const SbVec4d & v)
staticinherited

Definition at line 67 of file VP1String.cxx.

67{ double x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [19/30]

QString VP1String::str ( const SbVec4f & v)
staticinherited

Definition at line 68 of file VP1String.cxx.

68{ float x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [20/30]

template<class T>
QString VP1String::str ( const T * t)
inlinestaticinherited

Definition at line 87 of file VP1String.h.

87{ return str(static_cast<const void* >(t)); }

◆ str() [21/30]

QString VP1String::str ( const void * p)
staticinherited

Definition at line 48 of file VP1String.cxx.

49{
50 if (p) {
51 std::ostringstream s;
52 s << p;
53 // Explicitly naming QString here avoids a cppcheck warning.
54 return QString (s.str().c_str());
55 } else {
56 return "NULL";
57 }
58}

◆ str() [22/30]

QString VP1String::str ( const VP1Interval & i)
staticinherited

Definition at line 42 of file VP1String.cxx.

43{
44 return i.toString();
45}

◆ str() [23/30]

QString VP1String::str ( int n)
inlinestaticinherited

Definition at line 77 of file VP1String.h.

77{ return QString::number(n); }

◆ str() [24/30]

QString VP1String::str ( long n)
inlinestaticinherited

Definition at line 75 of file VP1String.h.

75{ return QString::number(n); }

◆ str() [25/30]

QString VP1String::str ( qlonglong n)
inlinestaticinherited

Definition at line 79 of file VP1String.h.

79{ return QString::number(n); }

◆ str() [26/30]

QString VP1String::str ( qulonglong n)
inlinestaticinherited

Definition at line 80 of file VP1String.h.

80{ return QString::number(n); }

◆ str() [27/30]

QString VP1String::str ( short int n)
inlinestaticinherited

Definition at line 73 of file VP1String.h.

73{ return QString::number(n); }

◆ str() [28/30]

QString VP1String::str ( uint n)
inlinestaticinherited

Definition at line 78 of file VP1String.h.

78{ return QString::number(n); }

◆ str() [29/30]

QString VP1String::str ( ulong n)
inlinestaticinherited

Definition at line 76 of file VP1String.h.

76{ return QString::number(n); }

◆ str() [30/30]

QString VP1String::str ( unsigned short int n)
inlinestaticinherited

Definition at line 74 of file VP1String.h.

74{ return QString::number(n); }

◆ sysmessage

void IVP1System::sysmessage ( QString ) const
signalinherited

◆ systemcreate()

void VP1GeometrySystem::systemcreate ( StoreGateSvc * detstore)
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 499 of file VP1GeometrySystem.cxx.

500{
501 m_d->ensureInitVisAttributes();
502}

◆ systemerase()

void IVP13DSystemSimple::systemerase ( )
virtualinherited

Reimplemented in VP1AODSystem, VP1CaloCellSystem, VP1CaloClusterSystem, VP1CaloHitLegoSystem, VP1CaloLegoSystem, VP1MissingEtSystem, VP1PrepRawDataSystem, VP1RawDataSystem, VP1TrackSystem, and VP1VertexSystem.

Definition at line 28 of file IVP13DSystemSimple.cxx.

29{
30 // messageVerbose("WARNING: Did not reimplement systemerase!");
31}

◆ systemuncreate()

void VP1GeometrySystem::systemuncreate ( )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 313 of file VP1GeometrySystem.cxx.

314{
315
316 m_d->volumetreemodel->cleanup();
317 delete m_d->matVisAttributes; m_d->matVisAttributes = 0;
318 delete m_d->detVisAttributes; m_d->detVisAttributes = 0;
319 delete m_d->volVisAttributes; m_d->volVisAttributes = 0;
320
321 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList)
322 delete subsys;
323 m_d->subsysInfoList.clear();
324
325}

◆ toolSvc()

IToolSvc * IVP1System::toolSvc ( ) const
inherited

Definition at line 330 of file IVP1System.cxx.

331{
332 return VP1AthenaPtrs::toolSvc();
333}
static IToolSvc * toolSvc()

◆ uncreate()

void IVP13DSystemSimple::uncreate ( )
privatevirtualinherited

Reimplemented from IVP1System.

Definition at line 202 of file IVP13DSystemSimple.cxx.

203{
204
205 if(VP1Msg::verbose()){
206 messageDebug("uncreate()...");
207 }
208
209 assert(m_d->wascreated);
210 assert(!m_d->wasrefreshed);
211 m_d->rootE->enableNotify(false);
212 m_d->rootR->enableNotify(false);
214 m_d->root->removeAllChildren();
215 m_d->rootE->removeAllChildren();
216 m_d->rootR->removeAllChildren();
217 m_d->wascreated=false;
218}
virtual void systemuncreate()

◆ unregisterSelectionNode()

void IVP13DSystem::unregisterSelectionNode ( SoCooperativeSelection * selection)
inherited

Definition at line 281 of file IVP13DSystem.cxx.

282{
283 if (!selection) {
284 message("unregisterSelectionNode Error: NULL selection pointer!");
285 return;
286 }
288 message("registerSelectionNode Error: Trying to unregister unknown selection node!");
289 return;
290 }
291
292 selection->removeSelectionCallback( Imp::made_selection, selection );
293 selection->removeDeselectionCallback( Imp::made_deselection, selection );
294 selection->removeStartCallback( Imp::start_changeselection, this );
295 selection->removeFinishCallback( Imp::finished_changeselection, this );
296 selection->removeClickOutsideCallback( Imp::clickedoutside, this );
297
299 if (m_d->selectionsWithDisabledNotifications.contains(selection))
300 m_d->selectionsWithDisabledNotifications.remove(selection);
301 selection->unref();
302
303 messageVerbose("selection node unregistered");
304
305}

◆ updateGUI()

void IVP13DSystemSimple::updateGUI ( )
inlineinherited

Definition at line 89 of file IVP13DSystemSimple.h.

◆ updateTransparency

void VP1GeometrySystem::updateTransparency ( )
protectedslot

Definition at line 1501 of file VP1GeometrySystem.cxx.

1502{
1504
1505 float transparency = m_d->controller->transparency();
1506
1507 VolumeHandle* lastSelVol = m_d->controller->lastSelectedVolume();
1508 m_d->controller->setLastSelectedVolume(0);
1509 m_d->ensureInitVisAttributes();
1510 m_d->detVisAttributes->overrideTransparencies(transparency);
1511 m_d->matVisAttributes->overrideTransparencies(transparency);
1512 m_d->volVisAttributes->overrideTransparencies(transparency);
1513 m_d->controller->setLastSelectedVolume(lastSelVol);
1514}

◆ userChangedSelection()

void IVP13DSystem::userChangedSelection ( SoCooperativeSelection * ,
const QSet< SoNode * > & ,
QSet< SoPath * >  )
virtualinherited

◆ userClickedOnBgd()

void IVP13DSystem::userClickedOnBgd ( )
virtualinherited

Reimplemented in VP1AODSystem, VP1CaloReadoutSystem, VP1PrepRawDataSystem, and VP1TrackSystem.

Definition at line 62 of file IVP13DSystem.cxx.

62{}

◆ userDeselectedSingleNode()

void IVP13DSystem::userDeselectedSingleNode ( SoCooperativeSelection * ,
SoNode * ,
SoPath *  )
virtualinherited

Reimplemented in VP1AODSystem, VP1PrepRawDataSystem, and VP1TrackSystem.

Definition at line 60 of file IVP13DSystem.cxx.

60{}

◆ userPickedNode()

void VP1GeometrySystem::userPickedNode ( SoNode * pickedNode,
SoPath * pickedPath )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 813 of file VP1GeometrySystem.cxx.

814{
815
817 // We want to find the volumehandle for the volume. To do so, we look //
818 // for the SoSeparator identifying the actual picked shape node, and //
819 // use it to look up the handle: //
821
822 //Looking for the identifying "nodesep", there are three scenarios
823 //for the type signatures of the final part of the path:
824 //
825 // 1) Most shapes:
826 // nodesep -> pickedNode (but we must pop to a group node in case of SoCylinders)
827 //
828 // 2) Volumes Around Z (all phi sectors enabled):
829 // nodesep -> switch -> pickedNode
830 //
831 // 3) Volumes Around Z (only some phi sectors enabled):
832 // nodesep -> switch -> sep -> pickedNode
833 //
834 // In the third scenario we also have to pop the path, in order for
835 // all phi-slices of the part gets highlighted (since more than one
836 // soshape node represents the volume).
837
838
839 VP1Msg::messageDebug("VP1GeometrySystem::userPickedNode()");
840
841 if (pickedPath->getNodeFromTail(0)->getTypeId()==SoCylinder::getClassTypeId())
842 pickedPath->pop();
843
844 if (pickedPath->getLength()<5) {
845 message("Path too short");
846 return;
847 }
848
849 SoSeparator * nodesep(0);
850
851 if (pickedPath->getNodeFromTail(1)->getTypeId()==SoSeparator::getClassTypeId()
852 && pickedPath->getNodeFromTail(2)->getTypeId()==SoSwitch::getClassTypeId()
853 && pickedPath->getNodeFromTail(3)->getTypeId()==SoSeparator::getClassTypeId())
854 {
855 //Scenario 3:
856 nodesep = static_cast<SoSeparator*>(pickedPath->getNodeFromTail(3));
857 pickedPath->pop();//To get highlighting of siblings also.
858 }
859 else if (pickedPath->getNodeFromTail(1)->getTypeId()==SoSwitch::getClassTypeId()
860 && pickedPath->getNodeFromTail(2)->getTypeId()==SoSeparator::getClassTypeId())
861 {
862 //Scenario 2:
863 nodesep = static_cast<SoSeparator*>(pickedPath->getNodeFromTail(2));
864 }
865 else if (pickedPath->getNodeFromTail(1)->getTypeId()==SoSeparator::getClassTypeId()) {
866 //Scenario 1 (normal):
867 nodesep = static_cast<SoSeparator*>(pickedPath->getNodeFromTail(1));
868 }
869 if (!nodesep) {
870 message("Unexpected picked path");
871 return;
872 }
873 if ( (!(nodesep)) || (m_d->sonodesep2volhandle.find(nodesep) == m_d->sonodesep2volhandle.end()) ) {
874 message("Problems finding volume handle");
875 return;
876 }
877 VolumeHandle * volhandle = m_d->sonodesep2volhandle[nodesep];
878 if (!volhandle) {
879 message("Found NULL volume handle");
880 return;
881 }
882
884 // Next thing to do is to check whether volume was clicked on with a //
885 // modifier of SHIFT/CTRL/Z. If so, we have to change the state on //
886 // the volume handle. Otherwise, we need to print some information: //
888
889 //For focus reason, and since Qt doesn't allow standard keys such as
890 //'z' as modifiers, we check for keypress states using a combination
891 //of the inventor and Qt way
892
893 bool shift_isdown = (Qt::ShiftModifier & QApplication::keyboardModifiers());
894// || ( m_d->kbEvent && (SO_KEY_PRESS_EVENT(m_d->kbEvent, SoKeyboardEvent::LEFT_SHIFT)||
895// SO_KEY_PRESS_EVENT(m_d->kbEvent, SoKeyboardEvent::RIGHT_SHIFT)) ) );
896
897 if (shift_isdown) {
898 //Parent of volume should be put in CONTRACTED state.
899 deselectAll();
900 if (volhandle->parent())
902 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
903 return;
904 }
905
906 bool ctrl_isdown = (Qt::ControlModifier & QApplication::keyboardModifiers());
907// || ( m_d->kbEvent && (SO_KEY_PRESS_EVENT(m_d->kbEvent, SoKeyboardEvent::LEFT_CONTROL)||
908// SO_KEY_PRESS_EVENT(m_d->kbEvent, SoKeyboardEvent::RIGHT_CONTROL)) ) );
909
910 if (ctrl_isdown) {
911 //Volume should be put in EXPANDED state if it has children.
912 deselectAll();
913 if (volhandle->nChildren()>0) {
915 }
916 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
917 return;
918 }
919
920 bool z_isdown = m_d->kbEvent && SO_KEY_PRESS_EVENT(m_d->kbEvent,SoKeyboardEvent::Z);
921 if (z_isdown) {
922 //Volume should be put in ZAPPED state.
923 deselectAll();
924 volhandle->setState(VP1GeoFlags::ZAPPED);
925 message("===> Zapping Node: "+volhandle->getName());
926 // std::cout<<"Zapped VH="<<volhandle<<std::endl;
927 return;
928 }
929
931 // Depending on settings, we are to realign the camera if the //
932 // clicked volume is (daughter of) a muon chamber //
934
935 bool orientedView(false);
936 if (m_d->controller->orientViewToMuonChambersOnClick() && volhandle->isInMuonChamber()) {
937 //Volume is an, or is daughter of an, MDT, CSC or TGC chamber
939 orientedView = true;
940 //Now we must fix the tail of the pickedPath to ensure we
941 //select the correct node corresponding to the clicked volume
942 //again (it might have become attached/detached by the call to
943 //orientViewToMuonChamber):
944 if (!VP1QtInventorUtils::changePathTail(pickedPath,m_d->sceneroot,volhandle->nodeSoSeparator())) {
945 message("Warning: Failed to relocate picked node.");
946 deselectAll();
947 }
948 }
949
951 // Zoom to volume //
953
954 //Nb: We don't do this if we already oriented to the muon chamber above.
955 if (!orientedView&&m_d->controller->zoomToVolumeOnClick()) {
956 if (m_d->sceneroot&&volhandle->nodeSoSeparator()) {
957 std::set<SoCamera*> cameras = getCameraList();
958 std::set<SoCamera*>::iterator it,itE = cameras.end();
959 for (it=cameras.begin();it!=itE;++it) {
960 VP1CameraHelper::animatedZoomToSubTree(*it,m_d->sceneroot,volhandle->nodeSoSeparator(),2.0,1.0);
961 }
962 }
963 }
964
965
967 // Update last-select controls //
969
970 m_d->controller->setLastSelectedVolume(volhandle);
971
973 // OK, time to print some information for the volume //
975
976 message("===> Selected Node: "+volhandle->getName());
977 // std::cout<<"VolHandle = "<<volhandle<<std::endl;
978 if (m_d->controller->printInfoOnClick_Shape()) {
979 for (const QString& str : DumpShape::shapeToStringList(volhandle->geoPVConstLink()->getLogVol()->getShape()))
980 message(str);
981 }
982
983 if (m_d->controller->printInfoOnClick_Material()) {
984 message("===> Material:");
985 for (const QString& line : VP1GeomUtils::geoMaterialToStringList(volhandle->geoMaterial()))
986 message(" "+line);
987 }
988
989 if ( m_d->controller->printInfoOnClick_CopyNumber() ) {
990 int cn = volhandle->copyNumber();
991 message("===> CopyNo : "+(cn>=0?QString::number(cn):QString(cn==-1?"Invalid":"Error reconstructing copynumber")));
992 }
993
994 if ( m_d->controller->printInfoOnClick_Transform() ) {
995
996 float translation_x, translation_y, translation_z, rotaxis_x, rotaxis_y, rotaxis_z, rotangle_radians;
998 translation_x, translation_y, translation_z,
999 rotaxis_x, rotaxis_y, rotaxis_z, rotangle_radians );
1000 message("===> Local Translation:");
1001 message(" x = "+QString::number(translation_x/CLHEP::mm)+" mm");
1002 message(" y = "+QString::number(translation_y/CLHEP::mm)+" mm");
1003 message(" z = "+QString::number(translation_z/CLHEP::mm)+" mm");
1004 message("===> Local Rotation:");
1005 message(" axis x = "+QString::number(rotaxis_x));
1006 message(" axis y = "+QString::number(rotaxis_y));
1007 message(" axis z = "+QString::number(rotaxis_z));
1008 message(" angle = "+QString::number(rotangle_radians*180.0/M_PI)+" deg");
1010 translation_x, translation_y, translation_z,
1011 rotaxis_x, rotaxis_y, rotaxis_z, rotangle_radians );
1012 message("===> Global Translation:");
1013 message(" x = "+QString::number(translation_x/CLHEP::mm)+" mm");
1014 message(" y = "+QString::number(translation_y/CLHEP::mm)+" mm");
1015 message(" z = "+QString::number(translation_z/CLHEP::mm)+" mm");
1016 message("===> Global Rotation:");
1017 message(" axis x = "+QString::number(rotaxis_x));
1018 message(" axis y = "+QString::number(rotaxis_y));
1019 message(" axis z = "+QString::number(rotaxis_z));
1020 message(" angle = "+QString::number(rotangle_radians*180.0/M_PI)+" deg");
1021 }
1022
1023 if (m_d->controller->printInfoOnClick_Tree()) {
1024 std::ostringstream str;
1025 GeoPrintGraphAction pg(str);
1026 volhandle->geoPVConstLink()->exec(&pg);
1027 message("===> Tree:");
1028 for (const QString& line : QString(str.str().c_str()).split("\n"))
1029 message(" "+line);
1030 }
1031
1032 if (m_d->controller->printInfoOnClick_Mass()) {
1033 //FIXME: Move the mass calculations to the volume handles, and let
1034 //the common data cache some of the volume information by
1035 //logVolume).
1036 message("===> Total Mass &lt;===");
1037 message("Inclusive "+QString::number(Imp::inclusiveMass(volhandle->geoPVConstLink())/CLHEP::kilogram)+" kg");
1038 message("Exclusive "+QString::number(Imp::exclusiveMass(volhandle->geoPVConstLink())/CLHEP::kilogram)+" kg");
1039 }
1040
1041 if (m_d->controller->printInfoOnClick_MuonStationInfo()&&volhandle->isInMuonChamber()) {
1042 PVConstLink pvlink = volhandle->topLevelParent()->geoPVConstLink();
1043 std::map<PVConstLink,VolumeHandle*>::const_iterator itChamber = m_d->muonchambers_pv2handles.find(pvlink);
1044 #ifndef BUILDVP1LIGHT
1045 if (itChamber!=m_d->muonchambers_pv2handles.end()) {
1046 m_d->ensureInitPV2MuonStationMap();
1047 std::map<GeoPVConstLink,const MuonGM::MuonStation*>::const_iterator itStation(m_d->pv2MuonStation.find(pvlink));
1048 if (itStation!=m_d->pv2MuonStation.end()) {
1049 message("===> Muon station &lt;===");
1050 message(" ",m_d->stationInfo(itStation->second));
1051 }
1052 }
1053 #endif
1054 }
1055
1057 // Emit a signal for the VP1UtilitySystems::PartSpect system //
1059 QStack<QString> partspectPath, extras;
1060 QString detFactoryName;
1061
1062 VolumeHandle *parentVH(volhandle), *childVH(volhandle);
1063 m_d->createPathExtras(volhandle,detFactoryName,extras);
1064
1065 do {
1066 parentVH = parentVH->parent();
1067 PVConstLink parentPVLink = parentVH ? parentVH->geoPVConstLink() : childVH->geoPVConstLink()->getParent();
1068 if (parentPVLink) {
1069 int indexOfChild = parentVH ? childVH->childNumber() : parentPVLink->indexOf(childVH->geoPVConstLink()).value();
1070
1071 std::string childPVName = parentPVLink->getNameOfChildVol(indexOfChild);
1072 QString pathEntry = childPVName=="ANON" ? detFactoryName+childVH->getName() : QString(childPVName.c_str());
1073
1074 std::optional<int> childCopyNo = parentPVLink->getIdOfChildVol(indexOfChild);
1075 if(childCopyNo) {
1076 QString strCopyNo;
1077 strCopyNo.setNum(*childCopyNo);
1078 pathEntry += ("::"+strCopyNo);
1079 }
1080 partspectPath.push(pathEntry);
1081 childVH = parentVH;
1082 }
1083 }while(parentVH);
1084
1085 while(!extras.isEmpty())
1086 partspectPath.push(extras.pop());
1087
1088 partspectPath.push("Atlas::Atlas");
1089
1090 // Emit the signal
1091 //volhandle cannot be NULL here (coverity 16287)
1092 //int cn=(!volhandle) ? -1 : volhandle->copyNumber();
1093 int cn=volhandle->copyNumber();
1094 plotSpectrum(partspectPath,cn);
1095}
static QStringList shapeToStringList(const GeoShape *shape)
Definition DumpShape.cxx:34
static QStringList geoMaterialToStringList(const GeoMaterial *)
static double inclusiveMass(const PVConstLink &pv)
static double exclusiveMass(const PVConstLink &pv)
void orientViewToMuonChamber(const GeoPVConstLink &chamberPV)
void plotSpectrum(QStack< QString > &, int copyNumber=-1)
static void decodeTransformation(const SbMatrix &, float &translation_x, float &translation_y, float &translation_z, float &rotaxis_x, float &rotaxis_y, float &rotaxis_z, float &rotangle_radians)
static bool changePathTail(SoPath *path, SoNode *commonBranchPoint, SoNode *newtail)
const SbMatrix & getGlobalTransformToVolume() const
const GeoMaterial * geoMaterial() const
QString getName() const
SbMatrix getLocalTransformToVolume() const
VolumeHandle * topLevelParent()
GeoPVConstLink geoPVConstLink() const
int copyNumber() const
bool isInMuonChamber() const
VolumeHandle * parent()
unsigned nChildren() const

◆ userSelectedSingleNode()

void IVP13DSystem::userSelectedSingleNode ( SoCooperativeSelection * ,
SoNode * ,
SoPath *  )
virtualinherited

Reimplemented in VP1AODSystem, VP1PrepRawDataSystem, and VP1TrackSystem.

Definition at line 59 of file IVP13DSystem.cxx.

59{}

◆ verbose()

bool IVP1System::verbose ( )
inlinestaticinherited

Definition at line 86 of file IVP1System.h.

86{ return s_vp1verbose; }// Returns true if env var VP1_VERBOSE_OUTPUT=1
static const bool s_vp1verbose
Definition IVP1System.h:158

◆ volumeResetRequested

void VP1GeometrySystem::volumeResetRequested ( VolumeHandle * vh)
protectedslot

Definition at line 2750 of file VP1GeometrySystem.cxx.

2751{
2752 if (!vh)
2753 return;
2754 deselectAll();
2755 vh->reset();
2756 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2757}

◆ volumeStateChangeRequested

void VP1GeometrySystem::volumeStateChangeRequested ( VolumeHandle * vh,
VP1GeoFlags::VOLSTATE state )
protectedslot

Definition at line 2739 of file VP1GeometrySystem.cxx.

2740{
2741 //might not use this slot presently...
2742 if (!vh)
2743 return;
2744 deselectAll();
2745 vh->setState(state);
2746 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2747}

◆ warnOnDisabledNotifications()

void IVP13DSystemSimple::warnOnDisabledNotifications ( ) const
inherited

Definition at line 221 of file IVP13DSystemSimple.cxx.

222{
223 QList<SoNode*> nodesR;
224 QList<SoNode*> nodesE;
225 m_d->getNodesWithDisabledNotifications(m_d->rootR, nodesR);
226 m_d->getNodesWithDisabledNotifications(m_d->rootE, nodesE);
227 if (!nodesR.isEmpty()) {
228 message("WARNING: Found "+str(nodesR.count())+" node"+QString(nodesR.count()>1?"s":0)+" with disabled notifications in permanent scenegraph:");
229 for (SoNode * node : nodesR)
230 message(" => Node ("+str(node)+") of type "+QString(node->getTypeId().getName().getString())+", named "+QString(node->getName().getString()));
231 }
232 if (!nodesE.isEmpty()) {
233 message("WARNING: Found "+str(nodesE.count())+" node"+QString(nodesE.count()>1?"s":0)+" with disabled notifications in event scenegraph:");
234 for (SoNode * node : nodesE)
235 message(" => Node ("+str(node)+") of type "+QString(node->getTypeId().getName().getString())+", named "+QString(node->getName().getString()));
236 }
237}

Member Data Documentation

◆ m_d

Imp* VP1GeometrySystem::m_d
protected

Definition at line 104 of file VP1GeometrySystem.h.

◆ s_vp1verbose

const bool IVP1System::s_vp1verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")
staticprivateinherited

Definition at line 158 of file IVP1System.h.


The documentation for this class was generated from the following files: