diff --git a/GeoModelVisualization/VP1Base/src/IVP1System.cxx b/GeoModelVisualization/VP1Base/src/IVP1System.cxx index 5d2b3f3b4c2e7a0b5072cc6b31bf6ac2d4989d56..b7c6fffe4bb12cf991b399f8adf744b633a20c36 100644 --- a/GeoModelVisualization/VP1Base/src/IVP1System.cxx +++ b/GeoModelVisualization/VP1Base/src/IVP1System.cxx @@ -341,21 +341,24 @@ void IVP1System::message(const QString& str) const sysmessage(str); } else{ - std::cout<<VP1Msg::prefix_msg()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl; + //std::cout<<VP1Msg::prefix_msg()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl; + VP1Msg::message( QString(VP1Msg::prefix_msg()) + " [" + QString(m_d->name) + "]: " + QString(str) ); } } //_______________________________________________________ void IVP1System::messageDebug(const QString& str) const { - std::cout<<VP1Msg::prefix_debug()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl; + //std::cout<<VP1Msg::prefix_debug()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl; + VP1Msg::messageDebug( QString(VP1Msg::prefix_debug()) + " [" + QString(m_d->name) + "]: " + QString(str) ); } //_______________________________________________________ void IVP1System::messageVerbose(const QString& str) const { - if (VP1Msg::verbose()) - std::cout<<VP1Msg::prefix_verbose()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl; + //if (VP1Msg::verbose()) + //std::cout<<VP1Msg::prefix_verbose()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl; + VP1Msg::messageVerbose( QString(VP1Msg::prefix_verbose()) + " [" + QString(m_d->name) + "]: " + QString(str) ); } diff --git a/GeoModelVisualization/VP1Base/src/VP1Msg.cxx b/GeoModelVisualization/VP1Base/src/VP1Msg.cxx index ea0c75cf7e7d013213f920148cec3369a633bcc5..4afb2e5ddd4b7cd8c6f6ae7602e6b5aa4e5eccfb 100644 --- a/GeoModelVisualization/VP1Base/src/VP1Msg.cxx +++ b/GeoModelVisualization/VP1Base/src/VP1Msg.cxx @@ -32,7 +32,7 @@ void VP1Msg::message( const QString& str, IVP1System*sys ) if (sys) sys->message(str); else - std::cout << prefix_msg() << ": "<< str.toStdString()<<std::endl; + std::cout << "MEX!!!" << prefix_msg() << ": "<< str.toStdString()<<std::endl; } //____________________________________________________________________ @@ -41,7 +41,7 @@ void VP1Msg::messageDebug( const QString& str ) if (!debug()){ return; } - std::cout << prefix_debug() << ": "<< str.toStdString()<<std::endl; + std::cout << "DBG!!!" << prefix_debug() << ": "<< str.toStdString()<<std::endl; } //____________________________________________________________________ @@ -195,4 +195,4 @@ void VP1Msg::enableMsg(const QString& name){ VP1Msg::m_debug = VP1QtUtils::environmentVariableIsSet(name); } } -#endif \ No newline at end of file +#endif diff --git a/GeoModelVisualization/VP1GeometrySystems/src/PhiSectorManager.cxx b/GeoModelVisualization/VP1GeometrySystems/src/PhiSectorManager.cxx index 8c69d43da9539e0a0fe84ba21edb8b69a3e5a41d..cdd5f4f0894bc0f98a4ff4350dd455846de7d0cd 100644 --- a/GeoModelVisualization/VP1GeometrySystems/src/PhiSectorManager.cxx +++ b/GeoModelVisualization/VP1GeometrySystems/src/PhiSectorManager.cxx @@ -250,7 +250,7 @@ int PhiSectorManager::getVolumeType(const SbMatrix& transform, SoNode * shape) c //shape cannot be NULL here, so 'false' case is redundant (coverity 16272) //std::string Typenametest = shape ? shape->getTypeId().getName().getString() : "NULL"; std::string Typenametest = shape->getTypeId().getName().getString(); - m_d->system->message("WARNING: Unknown volume type (boolean?) for volume around Z-axis (type " + m_d->system->messageDebug("WARNING: Unknown volume type (boolean?) for volume around Z-axis (type " +QString(Typenametest.c_str())+"). Phi-sector cuts won't work for this!"); return -1; } diff --git a/GeoModelVisualization/VP1HEPVis/CMakeLists.txt b/GeoModelVisualization/VP1HEPVis/CMakeLists.txt index dd4cfed6b91f8eafb031343afe5dc99c47f5948c..d75338ba7a63d24740083a24e7a36923babb76e8 100644 --- a/GeoModelVisualization/VP1HEPVis/CMakeLists.txt +++ b/GeoModelVisualization/VP1HEPVis/CMakeLists.txt @@ -10,7 +10,7 @@ target_include_directories( GXHEPVis PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include> ) target_link_libraries( GXHEPVis - PUBLIC Coin::Coin OpenGL::GL GeoModelCore::GeoModelKernel) + PUBLIC Coin::Coin OpenGL::GL GeoModelCore::GeoModelKernel) source_group( "VP1HEPVis" FILES ${HEADERS} ) source_group( "src" FILES ${SOURCES} ) set_target_properties( GXHEPVis PROPERTIES diff --git a/GeoModelVisualization/VP1HEPVis/src/BooleanProcessor.h b/GeoModelVisualization/VP1HEPVis/src/BooleanProcessor.h index 5074bdf7724f587c159052d3155572696149e554..ec3782dd695b3c7324acc87b203f6301f3d8f923 100644 --- a/GeoModelVisualization/VP1HEPVis/src/BooleanProcessor.h +++ b/GeoModelVisualization/VP1HEPVis/src/BooleanProcessor.h @@ -2071,14 +2071,18 @@ HepPolyhedron BooleanProcessor::execute(int op, case OP_UNION: return b; case OP_INTERSECTION: + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "BooleanProcessor: intersection with empty polyhedron" << std::endl; + } return HepPolyhedron(); case OP_SUBTRACTION: + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "BooleanProcessor: subtraction from empty polyhedron" << std::endl; + } return HepPolyhedron(); } } @@ -2088,9 +2092,11 @@ HepPolyhedron BooleanProcessor::execute(int op, case OP_UNION: return a; case OP_INTERSECTION: + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "BooleanProcessor: intersection with empty polyhedron" << std::endl; + } return HepPolyhedron(); case OP_SUBTRACTION: return a; diff --git a/GeoModelVisualization/VP1HEPVis/src/SbPolyhedron.cxx b/GeoModelVisualization/VP1HEPVis/src/SbPolyhedron.cxx index 6b0bb25b19b49e1a95ec9853dc26255f6a8634b4..5b389bf629a0b3c9ddb1f0870bae911c5830c432 100644 --- a/GeoModelVisualization/VP1HEPVis/src/SbPolyhedron.cxx +++ b/GeoModelVisualization/VP1HEPVis/src/SbPolyhedron.cxx @@ -17,9 +17,11 @@ #include <VP1HEPVis/SbTwistTrapFlatSide.h> #include "GeoModelKernel/Units.h" + #define SYSTEM_OF_UNITS GeoModelKernelUnits // so we will get, e.g., 'SYSTEM_OF_UNITS::cm' #include <cassert> +//#include <cstdlib>//For setenv/unsetenv #define perMillion 0.000001 #define deg (M_PI/180.0) @@ -1767,16 +1769,18 @@ SbPolyhedronCons::SbPolyhedronCons(double Rmn1, if (dphi > wholeCircle) k += 4; if (k != 0) { - std::cerr << "SbPolyhedronCone(s)/Tube(s): error in input parameters"; - if ((k & 1) != 0) std::cerr << " (radiuses)"; - if ((k & 2) != 0) std::cerr << " (half-length)"; - if ((k & 4) != 0) std::cerr << " (angles)"; - std::cerr << std::endl; - std::cerr << " Rmn1=" << Rmn1 << " Rmx1=" << Rmx1; - std::cerr << " Rmn2=" << Rmn2 << " Rmx2=" << Rmx2; - std::cerr << " Dz=" << Dz << " Phi1=" << Phi1 << " Dphi=" << Dphi + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base + std::cerr << "SbPolyhedronCone(s)/Tube(s): error in input parameters"; + if ((k & 1) != 0) std::cerr << " (radiuses)"; + if ((k & 2) != 0) std::cerr << " (half-length)"; + if ((k & 4) != 0) std::cerr << " (angles)"; + std::cerr << std::endl; + std::cerr << " Rmn1=" << Rmn1 << " Rmx1=" << Rmx1; + std::cerr << " Rmn2=" << Rmn2 << " Rmx2=" << Rmx2; + std::cerr << " Dz=" << Dz << " Phi1=" << Phi1 << " Dphi=" << Dphi << std::endl; - return; + } + return; } // P R E P A R E T W O P O L Y L I N E S @@ -1846,33 +1850,41 @@ SbPolyhedronPgon::SbPolyhedronPgon(double phi, // C H E C K I N P U T P A R A M E T E R S if (dphi <= 0. || dphi > 2*M_PI) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronPgon/Pcon: wrong delta phi = " << dphi << std::endl; + } return; } if (nz < 2) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronPgon/Pcon: number of z-planes less than two = " << nz << std::endl; + } return; } if (npdv < 0) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronPgon/Pcon: error in number of phi-steps =" << npdv << std::endl; + } return; } int i; for (i=0; i<nz; i++) { if (rmin[i] < 0. || rmax[i] < 0. || rmin[i] > rmax[i]) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronPgon: error in radiuses rmin[" << i << "]=" << rmin[i] << " rmax[" << i << "]=" << rmax[i] << std::endl; + } return; } } @@ -1940,23 +1952,29 @@ SbPolyhedronSphere::SbPolyhedronSphere(double rmin, double rmax, // C H E C K I N P U T P A R A M E T E R S if (dphi <= 0. || dphi > 2*M_PI) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronSphere: wrong delta phi = " << dphi << std::endl; + } return; } if (the < 0. || the > M_PI) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronSphere: wrong theta = " << the << std::endl; + } return; } if (dthe <= 0. || dthe > M_PI) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronSphere: wrong delta theta = " << dthe << std::endl; + } return; } @@ -1964,18 +1982,22 @@ SbPolyhedronSphere::SbPolyhedronSphere(double rmin, double rmax, dthe = M_PI - the; //G.Barrand : coming from LHCb/S.Ponce. if (the+dthe > M_PI) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronSphere: wrong theta + delta theta = " << the << " " << dthe << std::endl; + } return; } if (rmin < 0. || rmin >= rmax) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronSphere: error in radiuses" << " rmin=" << rmin << " rmax=" << rmax << std::endl; + } return; } @@ -2041,17 +2063,21 @@ SbPolyhedronTorus::SbPolyhedronTorus(double rmin, // C H E C K I N P U T P A R A M E T E R S if (dphi <= 0. || dphi > 2*M_PI) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronTorus: wrong delta phi = " << dphi << std::endl; + } return; } if (rmin < 0. || rmin >= rmax || rmax >= rtor) { + if ( getenv("VP1MSG_DEBUG_OUTPUT") ) { // TODO: to be replaced by VP1Msg::debug(), when moved outside of VP1Base std::cerr << "SbPolyhedronTorus: error in radiuses" << " rmin=" << rmin << " rmax=" << rmax << " rtorus=" << rtor << std::endl; + } return; }