diff --git a/GeoModelVisualization/CMakeLists.txt b/GeoModelVisualization/CMakeLists.txt index 873e30b93bf3efda7dd79071cb21d5ec9c6b50a0..b2539695ffc86ef721cdd4ecd704ed782d058a43 100644 --- a/GeoModelVisualization/CMakeLists.txt +++ b/GeoModelVisualization/CMakeLists.txt @@ -66,6 +66,7 @@ add_subdirectory(VP1Gui) add_subdirectory(VP1Base) add_subdirectory(VP1HEPVis) add_subdirectory(VP1GuideLineSystems) +add_subdirectory(GXHitDisplaySystems) # Create and install the version description of the project. include( WriteBasicConfigVersionFile ) diff --git a/GeoModelVisualization/GXClashPointSystems/GXClashPointSystems/GXClashPointSystem.h b/GeoModelVisualization/GXClashPointSystems/GXClashPointSystems/GXClashPointSystem.h index 55ae390811efeca5c11876599115c2a85200a1f6..177e69d1fde773907ae0ec9fededdcb8f39566c0 100644 --- a/GeoModelVisualization/GXClashPointSystems/GXClashPointSystems/GXClashPointSystem.h +++ b/GeoModelVisualization/GXClashPointSystems/GXClashPointSystems/GXClashPointSystem.h @@ -49,6 +49,9 @@ public slots: void showClashPoint3(bool); void showClashPoint4(bool); void setPointSize(int); + +signals: + void updateTransparencyType(unsigned type); private: class Imp; diff --git a/GeoModelVisualization/GXHitDisplaySystems/.DS_Store b/GeoModelVisualization/GXHitDisplaySystems/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1d1227246812d83e733cc2dc14c54663b883c7d8 Binary files /dev/null and b/GeoModelVisualization/GXHitDisplaySystems/.DS_Store differ diff --git a/GeoModelVisualization/GXHitDisplaySystems/CMakeLists.txt b/GeoModelVisualization/GXHitDisplaySystems/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..63ff3d15a716ff39dc314daacadf9b94100c9bd8 --- /dev/null +++ b/GeoModelVisualization/GXHitDisplaySystems/CMakeLists.txt @@ -0,0 +1,41 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +# Find the header and source files. +file( GLOB SOURCES src/*.cxx ) +file( GLOB HEADERS GXHitDisplaySystems/*.h ) +file( GLOB UIS src/*.ui ) + +# Add the library. +add_library( GXHitDisplaySystems SHARED ${SOURCES} ${HEADERS} ${UIS} ) +target_link_libraries( GXHitDisplaySystems + PUBLIC Coin::Coin GXBase + PRIVATE Qt5::Core Qt5::Widgets nlohmann_json::nlohmann_json ) +target_include_directories( GXHitDisplaySystems PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> + $<INSTALL_INTERFACE:include> ) +source_group( "GXHitDisplaySystems" FILES ${HEADERS} ) +source_group( "src" FILES ${SOURCES} ${UIS} ${RCS} ) +set_target_properties( GXHitDisplaySystems PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} ) +if( GEOMODEL_USE_BUILTIN_COIN3D ) + add_dependencies( GXHitDisplaySystems Coin3DBuiltIn ) +endif() +if( GEOMODEL_USE_BUILTIN_JSON ) + add_dependencies( GXHitDisplaySystems JSONExt ) +endif() + +# Set up an alias with the same name that you would get by "finding" a pre-built +# version of the library. +add_library( GeoModelVisualization::GXHitDisplaySystems ALIAS + GXHitDisplaySystems ) + +# Install the library. +install( TARGETS GXHitDisplaySystems + EXPORT ${PROJECT_NAME}-export + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT Runtime + NAMELINK_COMPONENT Development ) +install( FILES ${HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GXClashPointSystems + COMPONENT Development ) diff --git a/GeoModelVisualization/GXHitDisplaySystems/GXHitDisplaySystems/GXHitDisplaySystem.h b/GeoModelVisualization/GXHitDisplaySystems/GXHitDisplaySystems/GXHitDisplaySystem.h new file mode 100644 index 0000000000000000000000000000000000000000..e10e206269af68e6fa08a322a3f028c3d4e444a3 --- /dev/null +++ b/GeoModelVisualization/GXHitDisplaySystems/GXHitDisplaySystems/GXHitDisplaySystem.h @@ -0,0 +1,58 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef GXHITDISPLAYSYSTEM_H +#define GXHITDISPLAYSYSTEM_H + +///////////////////////////////////////////////////////////////////////// +// // +// Header file for class GXHitDisplaySystem // +// // +// Author: Joseph F. Boudreau <boudreau@pitt.edu> // +// // +// Initial version: March 2020 // +// // +///////////////////////////////////////////////////////////////////////// + +#include "VP1Base/IVP13DSystemSimple.h" + +class GXHitDisplaySystem : public IVP13DSystemSimple { + + Q_OBJECT + +public: + + /////////////////// + // Constructor // + /////////////////// + + GXHitDisplaySystem(); + + ////////////////////////////////////////// + // Reimplementations from base class: // + ////////////////////////////////////////// + + virtual ~GXHitDisplaySystem(); + void buildPermanentSceneGraph(StoreGateSvc* detstore, SoSeparator *root); + void buildEventSceneGraph(StoreGateSvc*, SoSeparator *); + void systemuncreate(); + QWidget * buildController(); + QByteArray saveState(); + void restoreFromState(QByteArray ba); + +public slots: + + void selectInputFile(); + void showHitDisplay1(bool); + void setPointSize(int); + +signals: + void updateTransparencyType(unsigned type); + +private: + class Imp; + Imp * m_d; +}; + +#endif diff --git a/GeoModelVisualization/GXHitDisplaySystems/GXHitDisplaySystems/HitDisplaySysController.h b/GeoModelVisualization/GXHitDisplaySystems/GXHitDisplaySystems/HitDisplaySysController.h new file mode 100644 index 0000000000000000000000000000000000000000..12757d4fc74ec01aee969c5916500621c5309daa --- /dev/null +++ b/GeoModelVisualization/GXHitDisplaySystems/GXHitDisplaySystems/HitDisplaySysController.h @@ -0,0 +1,59 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + + +//////////////////////////////////////////////////////////////// +// // +// Implementation of class HitDisplaySysController // +// // +// Author: Joseph F. Boudreau (boudreau@pitt.edu) // +// Initial version: March 2020 // +// // +//////////////////////////////////////////////////////////////// + + +#ifndef CLASHPOINTSYSCONTROLLER_H +#define CLASHPOINTSYSCONTROLLER_H + +#include "VP1Base/VP1Controller.h" +#include <Inventor/C/errors/debugerror.h> +#include <Inventor/SbColor4f.h> + +class HitDisplaySysController : public VP1Controller { + + Q_OBJECT + +public: + + HitDisplaySysController(IVP1System * sys); + virtual ~HitDisplaySysController(); + + void actualRestoreSettings(VP1Deserialise&); + int currentSettingsVersion() const; + void actualSaveSettings(VP1Serialise&) const; + + //HitDisplays: + bool showHitDisplays1() const; + int setPointSize() const; + +signals: + + void showHitDisplays1Changed(bool); + void setPointSizeChanged(int); + void inputFileChanged(); + +private: + + class Imp; + Imp * m_d; + +private slots: + void possibleChange_showHitDisplays1(); + void possibleChange_setPointSize(); + +}; + + +#endif diff --git a/GeoModelVisualization/GXHitDisplaySystems/src/GXHitDisplaySystem.cxx b/GeoModelVisualization/GXHitDisplaySystems/src/GXHitDisplaySystem.cxx new file mode 100644 index 0000000000000000000000000000000000000000..35b61555c68f5adfd5c5170bad9564fbd5a7f558 --- /dev/null +++ b/GeoModelVisualization/GXHitDisplaySystems/src/GXHitDisplaySystem.cxx @@ -0,0 +1,267 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +///////////////////////////////////////////////////////////////////////// +// // +// Implementation of class GXHitDisplaySystem // +// // +// Author: Thomas Kittelmann <Thomas.Kittelmann@cern.ch> // +// // +// Initial version: July 2007 // +// // +///////////////////////////////////////////////////////////////////////// + +#include "GXHitDisplaySystems/GXHitDisplaySystem.h" +#include "GXHitDisplaySystems/HitDisplaySysController.h" + +#include "VP1Base/VP1Serialise.h" +#include "VP1Base/VP1Deserialise.h" +#include "VP1Base/VP1Msg.h" + +#include <Inventor/nodes/SoSeparator.h> +#include <Inventor/nodes/SoSwitch.h> +#include <Inventor/nodes/SoPointSet.h> +#include <Inventor/nodes/SoCoordinate3.h> +#include <Inventor/nodes/SoDrawStyle.h> +#include <Inventor/nodes/SoLightModel.h> +#include <Inventor/nodes/SoPickStyle.h> +#include <Inventor/nodes/SoBaseColor.h> +#include <Inventor/SbVec3f.h> + +#include <QFileDialog> + +#include <nlohmann/json.hpp> + +#include <map> +#include <iostream> +#include <fstream> +#include <unistd.h> + + +using json = nlohmann::json; + +class GXHitDisplaySystem::Imp { +public: + Imp(GXHitDisplaySystem*tc) : theclass(tc), + controller(0), + switch0(nullptr) + {} + GXHitDisplaySystem *theclass; + HitDisplaySysController * controller; + SoSwitch * switch0; + SoDrawStyle * drawStyle; + + static SbColor4f color4f(const QColor& col) { + return SbColor4f(std::max<float>(0.0f,std::min<float>(1.0f,col.redF())), + std::max<float>(0.0f,std::min<float>(1.0f,col.greenF())), + std::max<float>(0.0f,std::min<float>(1.0f,col.blueF())), + 1.0); + } + + +}; + +namespace hitdisp { + enum typeOfClash{ withMother=0, withSister, fullyEncapsSister, invalidSolid}; + // a simple struct to model a clash detection error + struct clash { + typeOfClash clashType; + std::string volume1Name; + int volume1CopyNo; + std::string volume1EntityType; + std::string volume2Name; + int volume2CopyNo; + std::string volume2EntityType; + double x,y,z; + double distance; + }; + + void to_json(json& j, const clash& p) { + j = json{{"typeOfClash", p.clashType}, {"volume1Name", p.volume1Name}, {"volume1CopyNo", p.volume1CopyNo}, {"volume1EntityType", p.volume1EntityType},{"volume2Name", p.volume2Name},{"volume2CopyNo", p.volume2CopyNo} +, {"volume2EntityType", p.volume2EntityType},{"x", p.x},{"y", p.y},{"z", p.z},{"distance[mm]", p.distance} }; + } + + void from_json(const json& j, clash& p) { + j.at("clashType").get_to(p.clashType); + j.at("volume1Name").get_to(p.volume1Name); + j.at("volume1CopyNo").get_to(p.volume1CopyNo); + j.at("volume1EntityType").get_to(p.volume1EntityType); + j.at("volume2Name").get_to(p.volume2Name); + j.at("volume2CopyNo").get_to(p.volume2CopyNo); + j.at("volume2EntityType").get_to(p.volume2EntityType); + j.at("x").get_to(p.x); + j.at("y").get_to(p.y); + j.at("z").get_to(p.z); + j.at("distance[mm]").get_to(p.distance); + + } +} // namespace hitdisp + + + + +//_____________________________________________________________________________________ +GXHitDisplaySystem::GXHitDisplaySystem() + : IVP13DSystemSimple("Hit Display", + "System providing visualizaton of hits", + "boudreau@pitt.edu"), m_d(new Imp(this)) +{ +} + + +//_____________________________________________________________________________________ +GXHitDisplaySystem::~GXHitDisplaySystem() +{ + delete m_d; +} + +//_____________________________________________________________________________________ +QWidget * GXHitDisplaySystem::buildController() +{ + m_d->controller = new HitDisplaySysController(this); + connect(m_d->controller, + SIGNAL(inputFileChanged()), + this, + SLOT(selectInputFile())); + + return m_d->controller; +} + +//_____________________________________________________________________________________ +void GXHitDisplaySystem::buildEventSceneGraph(StoreGateSvc*, SoSeparator *) +{ +} + +//_____________________________________________________________________________________ +void GXHitDisplaySystem::buildPermanentSceneGraph(StoreGateSvc* /*detstore*/, SoSeparator *root) +{ + //No guidelines are pickable: + SoPickStyle *pickStyle = new SoPickStyle; + pickStyle->style=SoPickStyle::UNPICKABLE; + root->addChild(pickStyle); + + m_d->drawStyle=new SoDrawStyle; + + m_d->drawStyle->pointSize.setValue(3); + root->addChild(m_d->drawStyle); + + SoSeparator *s0=new SoSeparator; + SoSeparator *s1=new SoSeparator; + SoSeparator *s2=new SoSeparator; + SoSeparator *s3=new SoSeparator; + + root->addChild(s0); + root->addChild(s1); + root->addChild(s2); + root->addChild(s3); + + + SoBaseColor *red=new SoBaseColor; + SoBaseColor *green=new SoBaseColor; + SoBaseColor *blue=new SoBaseColor; + SoBaseColor *folly=new SoBaseColor; + + red->rgb.setValue(1,0,0); + green->rgb.setValue(0,1,0); + blue->rgb.setValue(0,0,1); + folly->rgb.setValue(1.00,0,0.37); + + s0->addChild(red); + s1->addChild(green); + s2->addChild(blue); + s3->addChild(folly); + + m_d->switch0=new SoSwitch; + + m_d->switch0->whichChild=SO_SWITCH_ALL; + + + s0->addChild(m_d->switch0); + + connect(m_d->controller,SIGNAL(showHitDisplays1Changed(bool)),this,SLOT(showHitDisplay1(bool))); + connect(m_d->controller,SIGNAL(setPointSizeChanged(int)), this, SLOT(setPointSize(int))); +} + + + +//_____________________________________________________________________________________ +void GXHitDisplaySystem::systemuncreate() +{ + + m_d->controller=0; +} + + +//_____________________________________________________________________________________ +QByteArray GXHitDisplaySystem::saveState() { + + ensureBuildController(); + + VP1Serialise serialise(1/*version*/,this); + serialise.save(IVP13DSystemSimple::saveState()); + serialise.save(m_d->controller->saveSettings()); + serialise.disableUnsavedChecks();//We do the testing in the controller + return serialise.result(); +} + +//_____________________________________________________________________________________ +void GXHitDisplaySystem::restoreFromState(QByteArray ba) { + + VP1Deserialise state(ba,this); + ensureBuildController(); + + IVP13DSystemSimple::restoreFromState(state.restoreByteArray()); + m_d->controller->restoreSettings(state.restoreByteArray()); + state.disableUnrestoredChecks();//We do the testing in the controller +} + +void GXHitDisplaySystem::selectInputFile() { + + + QString path; + char buffer[1024]; + char *wd=getcwd(buffer,1024); + path = QFileDialog::getOpenFileName(nullptr, tr("Open Input File"), + wd, + tr("Clashpoint files (*.json)"),0,QFileDialog::DontUseNativeDialog); + SoGroup *switches[]={m_d->switch0}; + + if (path!="") { + m_d->switch0->removeAllChildren(); + std::ifstream i(path.toStdString()); + auto j=json::parse(i); + + try { + SoCoordinate3 *coords[]={new SoCoordinate3}; + unsigned int counter[]={0}; + + for (const auto& element : j["ClashesReport"]){ + hitdisp::typeOfClash type=element["typeOfClash"]; + coords[type]->point.set1Value(counter[type]++,element["x"], element["y"], element["z"]); + } + for (int i=0;i<1;i++) { + switches[i]->addChild(coords[i]); + SoPointSet *pointSet=new SoPointSet; + pointSet->numPoints=counter[i]; + switches[i]->addChild(pointSet); + } + } + catch (std::exception & e) { + std::cout << e.what() << std::endl; + } + + } + +} + +void GXHitDisplaySystem::setPointSize(int size) { + m_d->drawStyle->pointSize.setValue(size); +} + + +void GXHitDisplaySystem::showHitDisplay1(bool flag) { + m_d->switch0->whichChild=flag ? SO_SWITCH_ALL:SO_SWITCH_NONE; +} + diff --git a/GeoModelVisualization/GXHitDisplaySystems/src/HitDisplaySysController.cxx b/GeoModelVisualization/GXHitDisplaySystems/src/HitDisplaySysController.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f4f994e96ac9312e3b63fefe7dc863555016abfa --- /dev/null +++ b/GeoModelVisualization/GXHitDisplaySystems/src/HitDisplaySysController.cxx @@ -0,0 +1,107 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Implementation of class HitDisplaySysController // +// // +// Author: Joseph F. Boudreau (boudreau@pitt.edu) // +// Initial version: March 2020 // +// // +//////////////////////////////////////////////////////////////// + +#define VP1IMPVARNAME m_d + +#include "GXHitDisplaySystems/HitDisplaySysController.h" +#include "ui_hitdisplaycontrollerform.h" +#include "VP1Base/VP1Serialise.h" +#include "VP1Base/VP1Deserialise.h" +#include <cmath> + +//____________________________________________________________________ +class HitDisplaySysController::Imp { +public: + HitDisplaySysController * theclass; + Ui::GXHitDisplayControllerForm ui; + + bool last_showHitDisplays1; + int last_setPointSize; +}; +#include <iostream> +//____________________________________________________________________ +HitDisplaySysController::HitDisplaySysController(IVP1System * sys) + : VP1Controller(sys,"HitDisplaySysController"), m_d(new Imp) +{ + + m_d->theclass = this; + m_d->ui.setupUi(this); + + + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Setup connections which monitor changes in the controller so that we may emit signals as appropriate: // + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + + addUpdateSlot(SLOT(possibleChange_showHitDisplays1())); + connectToLastUpdateSlot(m_d->ui.hitDisplayCheckBox); + + addUpdateSlot(SLOT(possibleChange_setPointSize())); + connectToLastUpdateSlot(m_d->ui.pointSizeSpinBox); + + connect(m_d->ui.pushButton_selectInput, SIGNAL(clicked()), + this, SIGNAL(inputFileChanged())); + + initLastVars(); +} + +//____________________________________________________________________ +HitDisplaySysController::~HitDisplaySysController() +{ + delete m_d; +} + + +//____________________________________________________________________ +bool HitDisplaySysController::showHitDisplays1() const +{ + return m_d->ui.hitDisplayCheckBox->isChecked(); +} + +int HitDisplaySysController::setPointSize() const { + return m_d->ui.pointSizeSpinBox->value(); +} + +//____________________________________________________________________ +int HitDisplaySysController::currentSettingsVersion() const +{ + return 2; +} + +//____________________________________________________________________ +void HitDisplaySysController::actualSaveSettings(VP1Serialise&s) const +{ + + s.save(m_d->ui.hitDisplayCheckBox);//version 1+ + s.save(m_d->ui.pointSizeSpinBox); //version 2+ +} + +//____________________________________________________________________ +void HitDisplaySysController::actualRestoreSettings(VP1Deserialise& s) +{ + + s.restore(m_d->ui.hitDisplayCheckBox); + s.restore(m_d->ui.pointSizeSpinBox); + +} + + +/////////////////////////////////////////////////////////////////////////// +// Test for possible changes in values and emit signals as appropriate: +// (possibleChange_XXX() slots code provided by macros) +#define VP1CONTROLLERCLASSNAME HitDisplaySysController +#include "VP1Base/VP1ControllerMacros.h" +POSSIBLECHANGE_IMP(showHitDisplays1) +POSSIBLECHANGE_IMP(setPointSize) + diff --git a/GeoModelVisualization/GXHitDisplaySystems/src/hitdisplaycontrollerform.ui b/GeoModelVisualization/GXHitDisplaySystems/src/hitdisplaycontrollerform.ui new file mode 100644 index 0000000000000000000000000000000000000000..b0f151db7b448f09a0437fd906e4157683d9689c --- /dev/null +++ b/GeoModelVisualization/GXHitDisplaySystems/src/hitdisplaycontrollerform.ui @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>GXHitDisplayControllerForm</class> + <widget class="QWidget" name="GXHitDisplayControllerForm"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>268</width> + <height>243</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="1" column="1"> + <widget class="QSpinBox" name="pointSizeSpinBox"> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>10</number> + </property> + <property name="value"> + <number>3</number> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QPushButton" name="pushButton_selectInput"> + <property name="text"> + <string>Open Input</string> + </property> + </widget> + </item> + <item row="0" column="2"> + <spacer> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>1</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="pointSizeLabel"> + <property name="text"> + <string>Point size</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QCheckBox" name="hitDisplayCheckBox"> + <property name="text"> + <string>Hits</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + <item row="5" column="1"> + <widget class="QCommandLinkButton" name="nextEventButton"> + <property name="text"> + <string>Next Event</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <spacer> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>1</height> + </size> + </property> + </spacer> + </item> + <item row="6" column="1"> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/GeoModelVisualization/GeoModelExplorer/python/VP1EvtFilter.py b/GeoModelVisualization/GeoModelExplorer/python/VP1EvtFilter.py deleted file mode 100644 index 70004b097523725b1fe438df500e19feec5296d9..0000000000000000000000000000000000000000 --- a/GeoModelVisualization/GeoModelExplorer/python/VP1EvtFilter.py +++ /dev/null @@ -1,65 +0,0 @@ -## -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -## - -def readFileSimplified(filename): - import os.path - if not os.path.exists(filename): return None - lines = [] - for l in open(filename): - if '#' in l: l = l[0:l.index('#')] #Remove comments - l=' '.join(l.split())#simplify whitespace - if l: lines += [l] - return lines - -def filterEntry(parts): - #parts is either [evt] or [run,evt]: - assert len(parts) in [1,2] - filter_run = int(parts[0]) if len(parts)==2 else None - filter_evt = int(parts[1]) if len(parts)==2 else int(parts[0]) - assert (filter_run==None or filter_run>=0) and filter_evt>=0 - return (filter_run,filter_evt) - -def readFiltersFromFile(filename): - lines = readFileSimplified(filename) - if lines==None: return None - filts=[] - for l in lines: - filts+=[filterEntry(l.replace(':',' ').split())] - return filts - -def parseFilterString(s): - import os.path - excludemode=False - if s.startswith('%'): - excludemode=True - s=s[1:] - try: - filters=[] - tmp=s - for filt in tmp.split(','): - if os.path.exists(filt): - #This is a file... - for filefilt in readFiltersFromFile(filt): - filters += [filefilt] - continue - filters += [filterEntry(filt.split(':'))] - except: - filters=[] - def vp1CfgErr(s): print "VP1 CONFIGURATION ERROR: %s" % s#fixme: should go in common utils module - vp1CfgErr("Badly formatted filter string '%s'" % str(s)) - raise - return (excludemode,filters) - -def installEventFilter(filters): - def vp1filter(run,evt): - print "vp1filter(%i,%i) called" %(run,evt) - for filter in filters[1]: - if evt==filter[1] and (filter[0]==None or filter[0]==run): return not filters[0] - return filters[0] - from AthenaCommon.AlgSequence import AthSequencer - seq = AthSequencer('AthFilterSeq') - from GaudiSequencer.PyComps import PyEvtFilter - seq += PyEvtFilter ('vp1filteralg') - seq.vp1filteralg.filter_fct = vp1filter - seq.vp1filteralg.evt_info = ''#To trigger keyless retrieve of the EventInfo diff --git a/GeoModelVisualization/GeoModelExplorer/share/clear-bash-hash-table-vp1 b/GeoModelVisualization/GeoModelExplorer/share/clear-bash-hash-table-vp1 deleted file mode 100644 index 6d6c0df03cddd38a957705bb0813426b3e8040ba..0000000000000000000000000000000000000000 --- a/GeoModelVisualization/GeoModelExplorer/share/clear-bash-hash-table-vp1 +++ /dev/null @@ -1,12 +0,0 @@ -## -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -## - -#!/bin/bash -# Script which rebuilds the Bash hash table for the 'vp1' executable, -# after changing and recompiling the share/vp1 script -# -# Riccardo M. BIANCHI <rbianchi@cern.ch>, First version Jan 2016. - -echo "clear the Bash hash table for the 'vp1' executable -hash -d vp1 diff --git a/GeoModelVisualization/VP1GeometryPlugin/CMakeLists.txt b/GeoModelVisualization/VP1GeometryPlugin/CMakeLists.txt index f6f0e6669b5aaec8d485f1d8d3bd59af39968513..9e19b1807fddd7cf7c186c22069aa6aba8746c86 100644 --- a/GeoModelVisualization/VP1GeometryPlugin/CMakeLists.txt +++ b/GeoModelVisualization/VP1GeometryPlugin/CMakeLists.txt @@ -8,7 +8,7 @@ file( GLOB HEADERS VP1GeometryPlugin/*.h ) add_library( GXGeometryPlugin MODULE ${SOURCES} ${HEADERS} ) target_link_libraries( GXGeometryPlugin PUBLIC Qt5::Core GXBase - PRIVATE GXGeometrySystems GXGuideLineSystems GXClashPointSystems ) + PRIVATE GXGeometrySystems GXGuideLineSystems GXClashPointSystems GXHitDisplaySystems ) target_include_directories( GXGeometryPlugin PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include> ) diff --git a/GeoModelVisualization/VP1GeometryPlugin/src/VP1GeometryChannel.cxx b/GeoModelVisualization/VP1GeometryPlugin/src/VP1GeometryChannel.cxx index dbf62f9fc6180b15bfda41d2121d9c7a81a8ee85..d4c8299caef10c73a7ed570108a102d31a3ebe8b 100644 --- a/GeoModelVisualization/VP1GeometryPlugin/src/VP1GeometryChannel.cxx +++ b/GeoModelVisualization/VP1GeometryPlugin/src/VP1GeometryChannel.cxx @@ -16,6 +16,7 @@ #include "VP1GeometrySystems/VP1GeometrySystem.h" #include "VP1GuideLineSystems/VP1GuideLineSystem.h" #include "GXClashPointSystems/GXClashPointSystem.h" +#include "GXHitDisplaySystems/GXHitDisplaySystem.h" #include "VP1Base/VP1QtUtils.h" VP1GeometryChannel::VP1GeometryChannel() @@ -30,6 +31,7 @@ void VP1GeometryChannel::init() addSystem(new VP1GeometrySystem); if (VP1QtUtils::environmentVariableIsOn("VP1_SECOND_GEOMSYS")) addSystem(new VP1GeometrySystem("AltGeo"),IVP13DStandardChannelWidget::StartDisabled); - addSystem(new VP1GuideLineSystem); - addSystem(new GXClashPointSystem); + addSystem(new VP1GuideLineSystem, IVP13DStandardChannelWidget::StartDisabled); + addSystem(new GXClashPointSystem, IVP13DStandardChannelWidget::StartDisabled); + addSystem(new GXHitDisplaySystem, IVP13DStandardChannelWidget::StartDisabled); } diff --git a/GeoModelVisualization/VP1GuideLineSystems/VP1GuideLineSystems/VP1GuideLineSystem.h b/GeoModelVisualization/VP1GuideLineSystems/VP1GuideLineSystems/VP1GuideLineSystem.h index 3e86df79532023cd1d066e5dfc35cbeeab3b01a8..f1f6d551cb827faae4dbf8198f153073436e6784 100644 --- a/GeoModelVisualization/VP1GuideLineSystems/VP1GuideLineSystems/VP1GuideLineSystem.h +++ b/GeoModelVisualization/VP1GuideLineSystems/VP1GuideLineSystems/VP1GuideLineSystem.h @@ -42,6 +42,10 @@ public: QByteArray saveState(); void restoreFromState(QByteArray ba); +signals: + + void updateTransparencyType(unsigned type); + private: class Imp; Imp * m_d;