Skip to content

Commit

Permalink
Merge branch 'FreeCAD:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sasobadovinac committed Jul 1, 2023
2 parents 620fb3f + 3d0fe64 commit fec767b
Show file tree
Hide file tree
Showing 697 changed files with 75,235 additions and 60,879 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sub_buildWindows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
-DFREECAD_COPY_LIBPACK_BIN_TO_BUILD=OFF
-DFREECAD_COPY_PLUGINS_BIN_TO_BUILD=ON
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v1.3
- name: Compiling sources
run: |
cd $env:builddir
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ install_manifest.txt
/cmake-build*/
/src/Tools/offlinedoc/localwiki/
/src/Tools/offlinedoc/*.txt
/conda/environment.yml
OpenSCAD_rc.py
tags

Expand Down
1 change: 0 additions & 1 deletion .vscode/.gitignore

This file was deleted.

4 changes: 2 additions & 2 deletions cMake/FindEigen3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

if(NOT Eigen3_FIND_VERSION)
if(NOT Eigen3_FIND_VERSION_MAJOR)
set(Eigen3_FIND_VERSION_MAJOR 2)
set(Eigen3_FIND_VERSION_MAJOR 3)
endif(NOT Eigen3_FIND_VERSION_MAJOR)
if(NOT Eigen3_FIND_VERSION_MINOR)
set(Eigen3_FIND_VERSION_MINOR 91)
set(Eigen3_FIND_VERSION_MINOR 0)
endif(NOT Eigen3_FIND_VERSION_MINOR)
if(NOT Eigen3_FIND_VERSION_PATCH)
set(Eigen3_FIND_VERSION_PATCH 0)
Expand Down
1 change: 0 additions & 1 deletion cMake/FreeCAD_Helpers/CheckInterModuleDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ macro(CheckInterModuleDependencies)
REQUIRES_MODS(BUILD_PART_DESIGN BUILD_SKETCHER)
# REQUIRES_MODS(BUILD_PATH BUILD_PART BUILD_MESH BUILD_ROBOT)
REQUIRES_MODS(BUILD_PATH BUILD_PART BUILD_MESH)
REQUIRES_MODS(BUILD_RAYTRACING BUILD_PART)
REQUIRES_MODS(BUILD_REVERSEENGINEERING BUILD_PART BUILD_MESH)
REQUIRES_MODS(BUILD_ROBOT BUILD_PART)
REQUIRES_MODS(BUILD_SANDBOX BUILD_PART BUILD_MESH)
Expand Down
3 changes: 1 addition & 2 deletions cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ macro(InitializeFreeCADBuildOptions)
endif()
else()
message("Libpack NOT found.\nIf you intend to use a Windows libpack, set the FREECAD_LIBPACK_DIR to the libpack directory.")
message(STATUS "Visit: https://github.com/apeltauer/FreeCAD/releases/ for Windows libpack downloads.")
message(STATUS "Visit: https://github.com/FreeCAD/FreeCAD-Libpack/releases/ for Windows libpack downloads.")
endif()
else(MSVC)
option(FREECAD_LIBPACK_USE "Use the LibPack to Build FreeCAD (only Win32 so far)." OFF)
Expand Down Expand Up @@ -119,7 +119,6 @@ macro(InitializeFreeCADBuildOptions)
option(BUILD_PATH "Build the FreeCAD path module" ON)
option(BUILD_PLOT "Build the FreeCAD plot module" ON)
option(BUILD_POINTS "Build the FreeCAD points module" ON)
option(BUILD_RAYTRACING "Build the FreeCAD ray tracing module" ON)
option(BUILD_REVERSEENGINEERING "Build the FreeCAD reverse engineering module" ON)
option(BUILD_ROBOT "Build the FreeCAD robot module" ON)
option(BUILD_SHOW "Build the FreeCAD Show module (helper module for visibility automation)" ON)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pyshp==2.3.1
PySide2==5.15.2.1
pysolar==0.10
PyYAML==6.0
requests==2.28.2
requests==2.31.0
rpdb2==2.0.0.1.2
sets==0.3.2
vermin==1.5.1
3 changes: 3 additions & 0 deletions src/App/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ SET(FreeCADApp_CPP_SRCS
ColorModel.cpp
ComplexGeoData.cpp
ComplexGeoDataPyImp.cpp
ElementMap.cpp
Enumeration.cpp
IndexedName.cpp
MappedElement.cpp
Expand All @@ -274,6 +275,7 @@ SET(FreeCADApp_CPP_SRCS
MaterialPyImp.cpp
Metadata.cpp
MetadataPyImp.cpp
ElementNamingUtils.cpp
StringHasher.cpp
StringHasherPyImp.cpp
StringIDPyImp.cpp
Expand All @@ -295,6 +297,7 @@ SET(FreeCADApp_HPP_SRCS
MappedElement.h
Material.h
Metadata.h
ElementNamingUtils.h
StringHasher.h
)

Expand Down
101 changes: 1 addition & 100 deletions src/App/ComplexGeoData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
# include <cstdlib>
#endif

#include <boost/algorithm/string/predicate.hpp>
#include <boost/regex.hpp>

#include "ComplexGeoData.h"

#include <Base/BoundBox.h>
#include <Base/Placement.h>
#include <Base/Rotation.h>
Expand Down Expand Up @@ -166,102 +166,3 @@ bool ComplexGeoData::getCenterOfGravity(Base::Vector3d&) const
return false;
}

const std::string &ComplexGeoData::elementMapPrefix() {
static std::string prefix(";");
return prefix;
}

const char *ComplexGeoData::isMappedElement(const char *name) {
if(name && boost::starts_with(name,elementMapPrefix()))
return name+elementMapPrefix().size();
return nullptr;
}

std::string ComplexGeoData::newElementName(const char *name) {
if(!name)
return std::string();
const char *dot = strrchr(name,'.');
if(!dot || dot==name)
return name;
const char *c = dot-1;
for(;c!=name;--c) {
if(*c == '.') {
++c;
break;
}
}
if(isMappedElement(c))
return std::string(name,dot-name);
return name;
}

std::string ComplexGeoData::oldElementName(const char *name) {
if(!name)
return std::string();
const char *dot = strrchr(name,'.');
if(!dot || dot==name)
return name;
const char *c = dot-1;
for(;c!=name;--c) {
if(*c == '.') {
++c;
break;
}
}
if(isMappedElement(c))
return std::string(name,c-name)+(dot+1);
return name;
}

std::string ComplexGeoData::noElementName(const char *name) {
if(!name)
return std::string();
auto element = findElementName(name);
if(element)
return std::string(name,element-name);
return name;
}

const char *ComplexGeoData::findElementName(const char *subname) {
if(!subname || !subname[0] || isMappedElement(subname))
return subname;
const char *dot = strrchr(subname,'.');
if(!dot)
return subname;
const char *element = dot+1;
if(dot==subname || isMappedElement(element))
return element;
for(--dot;dot!=subname;--dot) {
if(*dot == '.') {
++dot;
break;
}
}
if(isMappedElement(dot))
return dot;
return element;
}

const std::string &ComplexGeoData::tagPostfix() {
static std::string postfix(elementMapPrefix() + ":T");
return postfix;
}

const std::string &ComplexGeoData::indexPostfix() {
static std::string postfix(elementMapPrefix() + ":I");
return postfix;
}

const std::string &ComplexGeoData::missingPrefix() {
static std::string prefix("?");
return prefix;
}

bool ComplexGeoData::hasMissingElement(const char *subname) {
if(!subname)
return false;
auto dot = strrchr(subname,'.');
if(dot)
subname = dot+1;
return boost::starts_with(subname,missingPrefix());
}
35 changes: 0 additions & 35 deletions src/App/ComplexGeoData.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,41 +164,6 @@ class AppExport ComplexGeoData: public Base::Persistence, public Base::Handled
virtual bool getCenterOfGravity(Base::Vector3d& center) const;
//@}

/** @name Element name mapping */
//@{
/// Special prefix to mark the beginning of a mapped sub-element name
static const std::string &elementMapPrefix();
/// Special postfix to mark the following tag
static const std::string &tagPostfix();
/// Special postfix to mark the index of an array element
static const std::string &indexPostfix();
/// Special prefix to mark a missing element
static const std::string &missingPrefix();
/// Check if a subname contains missing element
static bool hasMissingElement(const char *subname);
/** Check if the name starts with elementMapPrefix()
*
* @param name: input name
* @return Returns the name stripped with elementMapPrefix(), or 0 if not
* start with the prefix
*/
static const char *isMappedElement(const char *name);

/// Strip out the trailing element name if there is mapped element name precedes it.
static std::string newElementName(const char *name);
/// Strip out the mapped element name if there is one.
static std::string oldElementName(const char *name);
/// Strip out the old and new element name if there is one.
static std::string noElementName(const char *name);

/// Find the start of an element name in a subname
static const char *findElementName(const char *subname);

static inline const char *hasMappedElementName(const char *subname) {
return isMappedElement(findElementName(subname));
}
//@}

protected:

/// from local to outside
Expand Down
6 changes: 3 additions & 3 deletions src/App/DocumentObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <Base/Writer.h>

#include "Application.h"
#include "ComplexGeoData.h"
#include "ElementNamingUtils.h"
#include "Document.h"
#include "DocumentObject.h"
#include "DocumentObjectExtension.h"
Expand Down Expand Up @@ -1094,7 +1094,7 @@ DocumentObject *DocumentObject::resolve(const char *subname,
// following it. So finding the last dot will give us the end of the last
// object name.
const char *dot=nullptr;
if(Data::ComplexGeoData::isMappedElement(subname) ||
if(Data::isMappedElement(subname) ||
!(dot=strrchr(subname,'.')) ||
dot == subname)
{
Expand All @@ -1117,7 +1117,7 @@ DocumentObject *DocumentObject::resolve(const char *subname,
if(!elementMapChecked) {
elementMapChecked = true;
const char *sub = dot==subname?dot:dot+1;
if(Data::ComplexGeoData::isMappedElement(sub)) {
if(Data::isMappedElement(sub)) {
lastDot = dot;
if(dot==subname)
break;
Expand Down
6 changes: 3 additions & 3 deletions src/App/DocumentObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <Base/Tools.h>

#include "Application.h"
#include "ComplexGeoData.h"
#include "ElementNamingUtils.h"
#include "Document.h"
#include "DocumentObserver.h"
#include "GeoFeature.h"
Expand Down Expand Up @@ -353,11 +353,11 @@ const std::string &SubObjectT::getSubName() const {
}

std::string SubObjectT::getSubNameNoElement() const {
return Data::ComplexGeoData::noElementName(subname.c_str());
return Data::noElementName(subname.c_str());
}

const char *SubObjectT::getElementName() const {
return Data::ComplexGeoData::findElementName(subname.c_str());
return Data::findElementName(subname.c_str());
}

std::string SubObjectT::getNewElementName() const {
Expand Down
Loading

0 comments on commit fec767b

Please sign in to comment.