diff --git a/CMakeLists.txt b/CMakeLists.txt index 98be85574f3794a4821503eb341ebd5014a03f74..29889930370b7a28aa2fcc922b33290ae13e861c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,7 +240,6 @@ if("${DESIRED_QT_VERSION}" STREQUAL "5") # # other modules must be enabled like this: set(QT_USE_QTXML TRUE) # needed! set(QT_USE_QTNETWORK TRUE) - MESSAGE(STATUS "Found Qt version: ${Qt5Core_VERSION_STRING}") elseif("${DESIRED_QT_VERSION}" STREQUAL "4") @@ -305,6 +304,8 @@ elseif( ${QT5_INSTALLED}) ${RCS} ) qt5_use_modules(JPSvis Widgets) + target_link_libraries(JPSvis Qt5::Xml) + target_link_libraries(JPSvis Qt5::Network) target_link_libraries(JPSvis ${Qt5Widgets_LIBRARIES}) else() message(FATAL_ERROR "QT NOT FOUND - ABORT") @@ -380,6 +381,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") endif() #-------------------- +if(NOT MSVC) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) @@ -391,6 +393,7 @@ else() message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") endif() message(STATUS "Checking for C++11 compiler - available") +endif(NOT MSVC) #--------------------- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") message(STATUS "Using Clang " ${CMAKE_CXX_COMPILER_VERSION}) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 822aa4f7031d0d281bf6a22b77190d678f4fb6ed..64bd3da6ec157d8492e1e9a1bbdb7fe6b62e774e 100755 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1882,7 +1882,7 @@ void MainWindow::slotShowGeometryStructure() //_geoStructure.setVisible(! _geoStructure.isVisible()); //_geoStructure.showColumn(0); //_geoStructure.show(); - _geoStructure.setHidden(not ui.actionShowGeometry_Structure->isChecked()); + _geoStructure.setHidden(!ui.actionShowGeometry_Structure->isChecked()); if(_visualisationThread->getGeometry().RefreshView()) { _geoStructure.setWindowTitle("Geometry structure"); diff --git a/src/SaxParser.cpp b/src/SaxParser.cpp index eb753d009075c3f011c95ab807e50beda6b99ca7..73696cfb67716b225aaa25f490343ca61d2304c3 100644 --- a/src/SaxParser.cpp +++ b/src/SaxParser.cpp @@ -485,12 +485,12 @@ bool SaxParser::startElement(const QString & /* namespaceURI */, } else if (qName == "agentInfo") { double height=std::numeric_limits<double>::quiet_NaN(); - int color=std::numeric_limits<int>::quiet_NaN(); - int id=std::numeric_limits<int>::quiet_NaN(); + double color=std::numeric_limits<double>::quiet_NaN(); + double id=std::numeric_limits<double>::quiet_NaN(); for(int i=0; i<at.length(); i++) { if(at.localName(i)=="ID") { - id=at.value(i).toInt(); + id=at.value(i).toDouble(); } if(at.localName(i)=="height") { height=at.value(i).toDouble()*FAKTOR; @@ -502,12 +502,12 @@ bool SaxParser::startElement(const QString & /* namespaceURI */, if(std::isnan(id)) return true; if(!std::isnan(height)) { - _initialPedestriansHeights.append(QString::number(id)); + _initialPedestriansHeights.append(QString::number(int(id))); _initialPedestriansHeights.append(QString::number(height)); } if(!std::isnan(color)) { - _initialPedestriansColors.append(QString::number(id)); - _initialPedestriansColors.append(QString::number(color)); + _initialPedestriansColors.append(QString::number(int(id))); + _initialPedestriansColors.append(QString::number(int(color))); } } return true; diff --git a/src/geometry/Building.cpp b/src/geometry/Building.cpp index dda5bfef89c83f5bfe2c16f42b948cdfa0e8f54e..1d125ab299ceb08f384eaa8b8adac1b478623a11 100644 --- a/src/geometry/Building.cpp +++ b/src/geometry/Building.cpp @@ -892,7 +892,7 @@ bool Building::IsVisible(const Point& p1, const Point& p2, const std::vector<Sub { for(auto&& sub: subrooms) { - if(sub and sub->IsVisible(p1,p2,considerHlines)==false) return false; + if(sub && sub->IsVisible(p1,p2,considerHlines)==false) return false; } } diff --git a/src/geometry/Line.cpp b/src/geometry/Line.cpp index 1df68720eaedde5e6bcd6df33c7a72aa3ae16cb2..823e6d9af9cce9ac9bc14da07de2d3944361e453 100644 --- a/src/geometry/Line.cpp +++ b/src/geometry/Line.cpp @@ -268,13 +268,13 @@ bool Line::Overlapp(const Line& l) const if(fabs(vecAB.Determinant(vecDC))<J_EPS) { - if( IsInLineSegment(l.GetPoint1()) and not HasEndPoint(l.GetPoint1())) + if( IsInLineSegment(l.GetPoint1()) && !HasEndPoint(l.GetPoint1())) { //Log->Write("ERROR: 1. Overlapping walls %s and %s ", toString().c_str(),l.toString().c_str()); return true; } - if( IsInLineSegment(l.GetPoint2()) and not HasEndPoint(l.GetPoint2())) + if( IsInLineSegment(l.GetPoint2()) && !HasEndPoint(l.GetPoint2())) { //Log->Write("ERROR: 2. Overlapping walls %s and %s ", toString().c_str(),l.toString().c_str()); return true; diff --git a/src/geometry/SubRoom.cpp b/src/geometry/SubRoom.cpp index 82209a1da1b1423536f0eed411fa7f322a7ee32b..19862d4fa8028611ed2c02b6e02476ee7cbe55fa 100644 --- a/src/geometry/SubRoom.cpp +++ b/src/geometry/SubRoom.cpp @@ -200,7 +200,7 @@ void SubRoom::AddTransition(Transition* line) void SubRoom::AddNeighbor(SubRoom* sub) { - if(sub and (IsElementInVector(_neighbors, sub)==false)) + if(sub && (IsElementInVector(_neighbors, sub)==false)) { _neighbors.push_back(sub); } @@ -528,7 +528,7 @@ bool SubRoom::SanityCheck() exit(EXIT_FAILURE); //return false; } - connected=connected or w1.ShareCommonPointWith(w2); + connected=connected || w1.ShareCommonPointWith(w2); } //overlapping with lines for(auto&& hline: _hlines) @@ -549,7 +549,7 @@ bool SubRoom::SanityCheck() exit(EXIT_FAILURE); //return false; } - connected=connected or w1.ShareCommonPointWith(*c); + connected=connected || w1.ShareCommonPointWith(*c); } //overlaping with transitions for(auto&& t: _transitions) @@ -560,10 +560,10 @@ bool SubRoom::SanityCheck() exit(EXIT_FAILURE); //return false; } - connected=connected or w1.ShareCommonPointWith(*t); + connected=connected || w1.ShareCommonPointWith(*t); } - if(not connected) + if(!connected) { Log->Write("ERROR: loose wall found %s in Room/Subroom %d/%d",w1.toString().c_str(),_roomID,_id); exit(EXIT_FAILURE); diff --git a/src/main.cpp b/src/main.cpp index 793a8fb8e434b8fd70f9b5f29ddc504353e7ca9b..9eec0ed51518204ff423290de29dd6cbed98b795 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,6 +59,14 @@ #include <QDir> #include <locale.h> +// for compiling a standalone windows exe with VS +#ifdef _MSC_VER +# ifdef NDEBUG +# pragma comment(linker, "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup") +# else +# pragma comment(linker, "/SUBSYSTEM:CONSOLE") +# endif +#endif #define vtkErrorMacro (x) ()