Skip to content

Commit

Permalink
Merge branch 'master' of github.com:FreeCAD/FreeCAD into TD-DetailWork
Browse files Browse the repository at this point in the history
  • Loading branch information
donovaly committed May 30, 2020
2 parents 74b2321 + 2330eef commit 92bd5b5
Show file tree
Hide file tree
Showing 459 changed files with 22,060 additions and 11,735 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Expand Up @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: FreeCAD
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://www.patreon.com/yorikvanhavre', 'https://www.patreon.com/kkremitzki', 'https://www.patreon.com/thundereal']
custom: ['https://www.patreon.com/yorikvanhavre', 'https://www.patreon.com/kkremitzki', 'https://www.patreon.com/thundereal', 'https://www.patreon.com/amrit3701']
30 changes: 18 additions & 12 deletions .travis.yml
Expand Up @@ -48,7 +48,8 @@ jobs:
# - python: 3.7
fast_finish: true # https://blog.travis-ci.com/2013-11-27-fast-finishing-builds
include:
- os: linux
- if: type != pull_request
os: linux
dist: bionic
language: cpp
compiler: clang
Expand All @@ -57,33 +58,33 @@ jobs:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- clang-9
- clang-10
env:
- CC=clang-9
- CXX=clang++-9
- CC=clang-10
- CXX=clang++-10
- CMAKE_ARGS="-DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_FEM_NETGEN=ON -DBUILD_QT5=ON"
- CACHE_NAME=JOB1

- os: linux
dist: bionic
language: cpp
compiler: gcc-9
compiler: gcc-10
cache: ccache
addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- gcc-9
- g++-9
- gcc-10
- g++-10
env:
- CC=gcc-9
- CXX=g++-9
- CC_FOR_BUILD=gcc-9
- CXX_FOR_BUILD=g++-9
- CC=gcc-10
- CXX=g++-10
- CC_FOR_BUILD=gcc-10
- CXX_FOR_BUILD=g++-10
- CMAKE_ARGS="-DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/cc -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_FEM_NETGEN=ON -DBUILD_QT5=ON"
- CACHE_NAME=JOB2

Expand Down Expand Up @@ -188,6 +189,11 @@ before_install:
# Runtime deps
sudo apt-get install -y --no-install-recommends freecad-daily-python3 python-pivy python3-pivy python-ply python3-ply
# Use newer Eigen to suppress warnings
# https://github.com/FreeCAD/FreeCAD/pull/3485
wget http://mirrors.kernel.org/ubuntu/pool/universe/e/eigen3/libeigen3-dev_3.3.7-2_all.deb
sudo dpkg -i libeigen3-dev_3.3.7-2_all.deb
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -27,6 +27,7 @@ set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE
set(PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")

# include local modules
include(CheckCXXCompilerFlag)
include(AddFileDependencies)
include(cMake/FreeCadMacros.cmake)
# include helper functions/macros
Expand All @@ -39,6 +40,7 @@ ConfigureCMakeVariables()
InitializeFreeCADBuildOptions()
CheckInterModuleDependencies()
FreeCADLibpackChecks()
SetupDoxygen()
if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
SetupPython()
SetupPCL()
Expand Down
4 changes: 4 additions & 0 deletions cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake
@@ -1,3 +1,7 @@
# Some resources
# https://github.com/dev-cafe/cmake-cookbook
# https://cmake.org/cmake/help/v3.8/manual/cmake-compile-features.7.html

macro(CompilerChecksAndSetups)
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
set(CMAKE_COMPILER_IS_CLANGXX TRUE)
Expand Down
12 changes: 12 additions & 0 deletions cMake/FreeCAD_Helpers/SetupDoxygen.cmake
@@ -0,0 +1,12 @@
macro(SetupDoxygen)
# -------------------------------- Doxygen ----------------------------------

find_package(Doxygen)

if (NOT DOXYGEN_FOUND)
message("=====================================================\n"
"Doxygen not found, will not build documentation. \n"
"=====================================================\n")
endif(NOT DOXYGEN_FOUND)

endmacro(SetupDoxygen)
1 change: 1 addition & 0 deletions package/fedora/freecad.spec
Expand Up @@ -70,6 +70,7 @@ BuildRequires: netgen-mesher-devel
BuildRequires: netgen-mesher-devel-private
BuildRequires: python3-pivy
BuildRequires: mesa-libEGL-devel
BuildRequires: openmpi-devel
BuildRequires: pcl-devel
BuildRequires: pyside2-tools
BuildRequires: python3
Expand Down
34 changes: 32 additions & 2 deletions src/3rdParty/salomesmesh/CMakeLists.txt
Expand Up @@ -9,11 +9,41 @@ SET(SMESH_VERSION_TWEAK 0)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-reorder -Wno-switch -Wno-unused-variable -Wno-unused-but-set-variable -Wno-comment -Wno-unused-parameter -Wno-empty-body -Wno-pedantic")
elseif(CMAKE_COMPILER_IS_CLANGXX)
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-sign-compare -Wno-reorder -Wno-switch -Wno-unused-variable -Wno-unused-private-field -Wno-unused-function -Wno-sometimes-uninitialized -Wno-overloaded-virtual -Wno-dynamic-class-memaccess -Wno-comment -Wno-unused-parameter -Wno-extra-semi")
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-self-assign -Wno-sign-compare -Wno-logical-op-parentheses -Wno-reorder -Wno-switch -Wno-switch-enum -Wno-unknown-pragmas -Wno-unused-variable -Wno-unused-private-field")
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-unused-function -Wno-sometimes-uninitialized -Wno-overloaded-virtual -Wno-dynamic-class-memaccess -Wno-comment -Wno-unused-parameter -Wno-extra-semi")
endif()

if(CMAKE_COMPILER_IS_CLANGXX)
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -Wno-self-assign -Wno-reorder -Wno-switch-enum -Wno-unknown-pragmas -Wno-logical-op-parentheses -Wno-unused-variable -Wno-unused-function -Wno-overloaded-virtual")
unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-deprecated-copy" _flag_found)
if (_flag_found)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy")
endif ()

unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-missing-field-initializers" _flag_found)
if (_flag_found)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
endif ()
elseif(CMAKE_COMPILER_IS_GNUCXX)
unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-unused-result" _flag_found)
if (_flag_found)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result")
endif ()

unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-maybe-uninitialized" _flag_found)
if (_flag_found)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized")
endif ()

unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-missing-field-initializers" _flag_found)
if (_flag_found)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
endif ()
endif()

if (VTK_OPTIONS)
Expand Down
Expand Up @@ -87,6 +87,10 @@ namespace nglib {
#undef NETGEN_PYTHON
#endif

#ifndef WIN32
#undef DLL_HEADER
#endif

#include <occgeom.hpp>
#include <meshing.hpp>
//#include <ngexception.hpp>
Expand Down
Expand Up @@ -55,6 +55,10 @@ namespace nglib {
#undef NETGEN_PYTHON
#endif

#ifndef WIN32
#undef DLL_HEADER
#endif

#include <meshing.hpp>

#if defined(__clang__)
Expand Down
Expand Up @@ -54,6 +54,10 @@ namespace nglib {
#undef NETGEN_PYTHON
#endif

#ifndef WIN32
#undef DLL_HEADER
#endif

#include <meshing.hpp>

#if defined(__clang__)
Expand Down
Expand Up @@ -72,6 +72,10 @@ namespace nglib {
#undef NETGEN_PYTHON
#endif

#ifndef WIN32
#undef DLL_HEADER
#endif

#include <occgeom.hpp>
#include <meshing.hpp>
//#include <meshing/meshtype.hpp>
Expand Down
Expand Up @@ -81,6 +81,10 @@
#undef NETGEN_PYTHON
#endif

#ifndef WIN32
#undef DLL_HEADER
#endif

#include <occgeom.hpp>

#if defined(__clang__)
Expand Down
2 changes: 1 addition & 1 deletion src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshEditor.cpp
Expand Up @@ -4168,7 +4168,7 @@ void SMESH_MeshEditor::Smooth (TIDSortedElemSet & theElems,
// if ( posType != SMDS_TOP_3DSPACE )
// dist2 = pNode.SquareDistance( surface->Value( newUV.X(), newUV.Y() ));
// if ( dist2 < dist1 )
uv = newUV;
uv = newUV;
}
}
// store UV in the map
Expand Down
2 changes: 1 addition & 1 deletion src/App/Enumeration.cpp
Expand Up @@ -220,7 +220,7 @@ bool Enumeration::contains(const char *value) const
// using string methods without set, use setEnums(const char** plEnums) first!
//assert(_EnumArray);

if (!isValid()) {
if (!getEnums()) {
return false;
}

Expand Down
35 changes: 19 additions & 16 deletions src/App/Expression.cpp
Expand Up @@ -350,23 +350,25 @@ static inline bool definitelyLessThan(T a, T b)

static inline int essentiallyInteger(double a, long &l, int &i) {
double intpart;
if(std::modf(a,&intpart) == 0.0) {
if(intpart<0.0) {
if(intpart >= INT_MIN) {
i = (int)intpart;
if (std::modf(a,&intpart) == 0.0) {
if (intpart<0.0) {
if (intpart >= INT_MIN) {
i = static_cast<int>(intpart);
l = i;
return 1;
}
if(intpart >= LONG_MIN) {
l = (long)intpart;
if (intpart >= LONG_MIN) {
l = static_cast<long>(intpart);
return 2;
}
}else if(intpart <= INT_MAX) {
i = (int)intpart;
}
else if (intpart <= INT_MAX) {
i = static_cast<int>(intpart);
l = i;
return 1;
}else if(intpart <= LONG_MAX) {
l = (int)intpart;
}
else if (intpart <= static_cast<double>(LONG_MAX)) {
l = static_cast<int>(intpart);
return 2;
}
}
Expand All @@ -375,14 +377,15 @@ static inline int essentiallyInteger(double a, long &l, int &i) {

static inline bool essentiallyInteger(double a, long &l) {
double intpart;
if(std::modf(a,&intpart) == 0.0) {
if(intpart<0.0) {
if(intpart >= LONG_MIN) {
l = (long)intpart;
if (std::modf(a,&intpart) == 0.0) {
if (intpart<0.0) {
if (intpart >= LONG_MIN) {
l = static_cast<long>(intpart);
return true;
}
}else if(intpart <= LONG_MAX) {
l = (long)intpart;
}
else if (intpart <= static_cast<double>(LONG_MAX)) {
l = static_cast<long>(intpart);
return true;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/App/FreeCADInit.py
Expand Up @@ -816,6 +816,7 @@ def report(self,msg,func,*args,**kargs):
App.Units.SpecificEnergy = App.Units.Unit(2,0,-2)
App.Units.ThermalConductivity = App.Units.Unit(1,1,-3,0,-1)
App.Units.ThermalExpansionCoefficient = App.Units.Unit(0,0,0,0,-1)
App.Units.VolumetricThermalExpansionCoefficient = App.Units.Unit(0,0,0,0,-1)
App.Units.SpecificHeat = App.Units.Unit(2,0,-2,0,-1)
App.Units.ThermalTransferCoefficient = App.Units.Unit(0,1,-3,0,-1)
App.Units.HeatFlux = App.Units.Unit(0,1,-3,0,0)
Expand Down
4 changes: 2 additions & 2 deletions src/App/Material.cpp
Expand Up @@ -268,7 +268,7 @@ void Material::setType(const MaterialType MatType)
break;
case CHROME:
ambientColor .set(0.3500f,0.3500f,0.3500f);
diffuseColor .set(0.4000f,0.4000f,0.4000f);
diffuseColor .set(0.9176f,0.9176f,0.9176f);
specularColor.set(0.9746f,0.9746f,0.9746f);
emissiveColor.set(0.0000f,0.0000f,0.0000f);
shininess = 0.1000f;
Expand Down Expand Up @@ -333,4 +333,4 @@ void Material::setType(const MaterialType MatType)
transparency = 0.0000f;
break;
}
}
}
30 changes: 21 additions & 9 deletions src/App/PropertyStandard.cpp
Expand Up @@ -152,12 +152,14 @@ void PropertyInteger::setPathValue(const ObjectIdentifier &path, const boost::an

if (value.type() == typeid(long))
setValue(boost::any_cast<long>(value));
else if (value.type() == typeid(int))
setValue(boost::any_cast<int>(value));
else if (value.type() == typeid(double))
setValue(boost::math::round(boost::any_cast<double>(value)));
else if (value.type() == typeid(float))
setValue(boost::math::round(boost::any_cast<float>(value)));
else if (value.type() == typeid(Quantity))
setValue(boost::math::round(boost::any_cast<Quantity>(value).getValue()));
else if (value.type() == typeid(int))
setValue(boost::any_cast<int>(value));
else
throw bad_cast();
}
Expand Down Expand Up @@ -430,7 +432,9 @@ void PropertyEnumeration::Restore(Base::XMLReader &reader)
}

if (val < 0) {
Base::Console().Warning("Enumeration index %d is out of range, ignore it\n", val);
// If the enum is empty at this stage do not print a warning
if (_enum.getEnums())
Base::Console().Warning("Enumeration index %d is out of range, ignore it\n", val);
val = getValue();
}

Expand Down Expand Up @@ -1026,14 +1030,18 @@ void PropertyFloat::setPathValue(const ObjectIdentifier &path, const boost::any
{
verifyPath(path);

if (value.type() == typeid(double))
setValue(boost::any_cast<double>(value));
else if (value.type() == typeid(Quantity))
setValue((boost::any_cast<Quantity>(value)).getValue());
else if (value.type() == typeid(long))
if (value.type() == typeid(long))
setValue(boost::any_cast<long>(value));
else if (value.type() == typeid(unsigned long))
setValue(boost::any_cast<unsigned long>(value));
else if (value.type() == typeid(int))
setValue(boost::any_cast<int>(value));
else if (value.type() == typeid(double))
setValue(boost::any_cast<double>(value));
else if (value.type() == typeid(float))
setValue(boost::any_cast<float>(value));
else if (value.type() == typeid(Quantity))
setValue((boost::any_cast<Quantity>(value)).getValue());
else
throw bad_cast();
}
Expand Down Expand Up @@ -1554,8 +1562,12 @@ void PropertyString::setPathValue(const ObjectIdentifier &path, const boost::any
setValue(boost::any_cast<bool>(value)?"True":"False");
else if (value.type() == typeid(int))
setValue(std::to_string(boost::any_cast<int>(value)));
else if (value.type() == typeid(long))
setValue(std::to_string(boost::any_cast<long>(value)));
else if (value.type() == typeid(double))
setValue(std::to_string(boost::math::round(App::any_cast<double>(value))));
setValue(std::to_string(App::any_cast<double>(value)));
else if (value.type() == typeid(float))
setValue(std::to_string(App::any_cast<float>(value)));
else if (value.type() == typeid(Quantity))
setValue(boost::any_cast<Quantity>(value).getUserString().toUtf8().constData());
else if (value.type() == typeid(std::string))
Expand Down
3 changes: 1 addition & 2 deletions src/Base/Tools.cpp
Expand Up @@ -34,8 +34,7 @@
#include "Tools.h"

namespace Base {
struct string_comp : public std::binary_function<std::string,
std::string, bool>
struct string_comp
{
// s1 and s2 must be numbers represented as string
bool operator()(const std::string& s1, const std::string& s2)
Expand Down

0 comments on commit 92bd5b5

Please sign in to comment.