Compare commits
165 Commits
fixSignCommand
...
1.0rc2
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d63fc6c2f | |||
| 99097c61f6 | |||
| b0d847ca15 | |||
| 95e93a3ab1 | |||
| e061f81beb | |||
| 94d1a67d88 | |||
| 8fe89409a5 | |||
| 29d4c9f13a | |||
| 98cb3ae80e | |||
| 288b6e6943 | |||
| 49aee8e57c | |||
| 555299ddea | |||
| a49e5c0c01 | |||
| 6eb92e6647 | |||
| b99e34bd86 | |||
| a48fd0f422 | |||
| b164b49b81 | |||
| 162eeeb5de | |||
| 7a1282a6da | |||
| 238c68d8eb | |||
| 7cc34c9072 | |||
| b2b0af95d8 | |||
| 6afb4a0220 | |||
| 50962ae9fe | |||
| 87e2d01ccb | |||
| 6625b675af | |||
| 7c16b82e70 | |||
| 72ae812aa4 | |||
| 4c3ffa617a | |||
| a5c4416bd0 | |||
| 24f67f2d87 | |||
| 580e7879d4 | |||
| 3cf5f0e086 | |||
| 18de22a8a7 | |||
| 28bcea6613 | |||
| 5755e70636 | |||
| f65a9ffec5 | |||
| 6d5c7ea855 | |||
| ae7fe1bc2e | |||
| acbce24dd9 | |||
| d0e0cf112f | |||
| 6310430e38 | |||
| 064abb30ee | |||
| 3c1b54200d | |||
| 25a0847e60 | |||
| 5f7eb6c16f | |||
| 915c05a289 | |||
| a82eb29af1 | |||
| e19f583e77 | |||
| dd31321038 | |||
| 4fd8b40f65 | |||
| 89b118e125 | |||
| b215a96f5d | |||
| eca9a105af | |||
| 814945f728 | |||
| 58d27094fa | |||
| 61cc23bda2 | |||
| d4006c4937 | |||
| fad1c30559 | |||
| 57c23537d0 | |||
| 255bdadf88 | |||
| 0312824742 | |||
| a323e03030 | |||
| c0941f9e22 | |||
| 7d13b17b1e | |||
| b1e611d7e3 | |||
| 4a57077f73 | |||
| d1903eabc7 | |||
| c093a79151 | |||
| 779e1b2bb5 | |||
| a86b0ad3fd | |||
| b55d54a417 | |||
| c5fef051f0 | |||
| 5e32fe2547 | |||
| 192314b070 | |||
| aba9c8d74d | |||
| 29ef93cbf3 | |||
| c6a273b789 | |||
| fa9d92a819 | |||
| 756d1a0a80 | |||
| 14ff4cb869 | |||
| 37b8fd1e40 | |||
| 53b878869e | |||
| d515ba9428 | |||
| 131618941c | |||
| 196312941c | |||
| d8ea9a6bca | |||
| 21af2176a6 | |||
| 358451359c | |||
| d00aae972c | |||
| 4e5e193c76 | |||
| 1c9432539a | |||
| add3a14b6e | |||
| 04ee5f8583 | |||
| 84ae76764e | |||
| 6f6205ff41 | |||
| f655c2545b | |||
| 5b38fc606c | |||
| 92663a8773 | |||
| 701dc43675 | |||
| 1bf69792ad | |||
| 6878ed9ffa | |||
| c478d2e22e | |||
| 769d46729a | |||
| 022fb23068 | |||
| 0a5ceb636c | |||
| 8e7fe5c5f2 | |||
| 15d79e8a7b | |||
| d5ab4bda33 | |||
| e790200395 | |||
| 1720ac8ac1 | |||
| 072d21135a | |||
| 8a19e37bec | |||
| a1c8874705 | |||
| 3a7448afac | |||
| 983fdfc671 | |||
| c2834e873d | |||
| dafc018b68 | |||
| bc815fd244 | |||
| e3ac0e4d09 | |||
| 6eefc8e649 | |||
| 20065e644b | |||
| 589027ebec | |||
| 6e203e7083 | |||
| f7108ddd92 | |||
| af3ea3bab3 | |||
| 4c473a17eb | |||
| 0e9fa777b3 | |||
| 0b9b4d5347 | |||
| 9f14e6e87b | |||
| 8828587084 | |||
| 687f01c84a | |||
| d07ae89f72 | |||
| bb3c7afe95 | |||
| 71c6a4f3d7 | |||
| bcd08a01ba | |||
| 8108b93058 | |||
| e7acb60253 | |||
| 985089a26d | |||
| 2dd4526531 | |||
| 20b996ab12 | |||
| d4feb51402 | |||
| ec61f5e3fb | |||
| 12b06306a3 | |||
| e94e12723f | |||
| d45016ee8a | |||
| b7514bf848 | |||
| 7a297f76bf | |||
| 54eb7b3d9f | |||
| 280548fb50 | |||
| 1a270ca088 | |||
| 455cad24eb | |||
| 7a6a82e2ca | |||
| 5fba69e328 | |||
| 708e07e594 | |||
| 9c95a7aa3a | |||
| 8cdcbe361f | |||
| 61bb5abfa2 | |||
| 422c7370a7 | |||
| 0165db7e79 | |||
| 3b192c533b | |||
| 2b609b64ec | |||
| b05dc2da73 | |||
| aa1ec60f65 | |||
| 60a251354e |
@@ -28,6 +28,9 @@ inputs:
|
||||
compiler:
|
||||
description: "Binary name/path of compiler to be used"
|
||||
required: true
|
||||
qt_major_version:
|
||||
description: "Major version number of qt to be used"
|
||||
required: true
|
||||
outputs:
|
||||
cacheKey:
|
||||
description: "Cache key with distro and compiler version"
|
||||
@@ -39,6 +42,6 @@ runs:
|
||||
- id: generateCacheKey
|
||||
shell: bash -l {0}
|
||||
run: |
|
||||
cacheKey=$(lsb_release -ds | tr -d ' ')-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)
|
||||
cacheKey=$(lsb_release -ds | tr -d ' ')-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)-qt${{ inputs.qt_major_version }}
|
||||
echo "Generated cache key : $cacheKey"
|
||||
echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT
|
||||
|
||||
@@ -59,7 +59,7 @@ runs:
|
||||
id: getCached
|
||||
with:
|
||||
path: ${{ inputs.ccachebindir }}
|
||||
key: ccacheforwin
|
||||
key: ccacheforwin-${{ inputs.ccacheversion }}
|
||||
- name: Download ccache
|
||||
shell: bash
|
||||
if: steps.getCached.outputs.cache-hit != 'true'
|
||||
|
||||
@@ -59,7 +59,7 @@ runs:
|
||||
id: getCached
|
||||
with:
|
||||
path: ${{ inputs.libpackdir }}
|
||||
key: libpackforwin
|
||||
key: libpackforwin-${{ inputs.libpackname }}
|
||||
- name: Download libpack
|
||||
shell: bash
|
||||
if: steps.getCached.outputs.cache-hit != 'true'
|
||||
|
||||
@@ -152,6 +152,7 @@ jobs:
|
||||
uses: ./.github/workflows/actions/linux/generateCacheKey
|
||||
with:
|
||||
compiler: ${{ env.CXX }}
|
||||
qt_major_version: 5
|
||||
- name: Restore Compiler Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
|
||||
@@ -102,6 +102,7 @@ jobs:
|
||||
uses: ./.github/workflows/actions/linux/generateCacheKey
|
||||
with:
|
||||
compiler: ${{ env.CXX }}
|
||||
qt_major_version: 5
|
||||
- name: Restore Compiler Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
|
||||
@@ -108,15 +108,16 @@ jobs:
|
||||
uses: ./.github/workflows/actions/linux/generateCacheKey
|
||||
with:
|
||||
compiler: ${{ env.CXX }}
|
||||
qt_major_version: 6
|
||||
- name: Restore Compiler Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
save-always: true
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}-qt6
|
||||
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-qt6-
|
||||
FC-${{ steps.genCacheKey.outputs.cacheKey }}-qt6-
|
||||
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-
|
||||
FC-${{ steps.genCacheKey.outputs.cacheKey }}-
|
||||
- name: Print CCache statistics before build, reset stats and print config
|
||||
run: |
|
||||
ccache -s
|
||||
|
||||
+3
-4
@@ -27,11 +27,10 @@ endif()
|
||||
|
||||
project(FreeCAD)
|
||||
|
||||
set(PACKAGE_VERSION_NAME "Vulcan")
|
||||
set(PACKAGE_VERSION_MAJOR "0")
|
||||
set(PACKAGE_VERSION_MINOR "22")
|
||||
set(PACKAGE_VERSION_MAJOR "1")
|
||||
set(PACKAGE_VERSION_MINOR "0")
|
||||
set(PACKAGE_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release)
|
||||
set(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string)
|
||||
set(PACKAGE_VERSION_SUFFIX "RC2") # either "dev" for development snapshot or "" (empty string)
|
||||
set(PACKAGE_BUILD_VERSION "0") # used when the same FreeCAD version will be re-released (for example using an updated LibPack)
|
||||
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
|
||||
|
||||
@@ -151,6 +151,10 @@
|
||||
},
|
||||
"cmakeExecutable": "${sourceDir}/conda/cmake.sh",
|
||||
"cacheVariables": {
|
||||
"CMAKE_IGNORE_PREFIX_PATH": {
|
||||
"type": "STRING",
|
||||
"value": "/opt/homebrew;/usr/local/homebrew"
|
||||
},
|
||||
"CMAKE_INCLUDE_PATH": {
|
||||
"type": "FILEPATH",
|
||||
"value": "${sourceDir}/.conda/freecad/include"
|
||||
|
||||
@@ -46,7 +46,7 @@ macro(CompilerChecksAndSetups)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
elseif(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+20")
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
elseif(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+17")
|
||||
else()#Enabled C++17
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ macro(SetGlobalCompilerAndLinkerSettings)
|
||||
if(FREECAD_RELEASE_PDB)
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG")
|
||||
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
|
||||
endif(FREECAD_RELEASE_PDB)
|
||||
if(FREECAD_RELEASE_SEH)
|
||||
# remove /EHsc or /EHs flags because they are incompatible with /EHa
|
||||
|
||||
Vendored
+1
-1
Submodule src/3rdParty/OndselSolver updated: 64e546fe80...91f70382be
+10
-1
@@ -25,6 +25,11 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// convenience for all the BSDs
|
||||
#if defined( __FreeBSD__) || defined( __NetBSD__) || defined( __OpenBSD__)
|
||||
#define __BSD
|
||||
#endif
|
||||
|
||||
#if defined( _WIN32 )
|
||||
#if defined( _MSC_VER )
|
||||
#include <codecvt>
|
||||
@@ -44,6 +49,10 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#elif defined(__BSD)
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#elif defined( __APPLE__ )
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
@@ -483,7 +492,7 @@ uint64_t CheckedFile::lseek64( int64_t offset, int whence )
|
||||
#endif
|
||||
#elif defined( __linux__ )
|
||||
int64_t result = ::lseek64( fd_, offset, whence );
|
||||
#elif defined( __APPLE__ )
|
||||
#elif defined( __APPLE__ ) || defined(__BSD)
|
||||
int64_t result = ::lseek( fd_, offset, whence );
|
||||
#else
|
||||
#error "no supported OS platform defined"
|
||||
|
||||
+44
-1
@@ -427,6 +427,10 @@ void Application::setupPythonException(PyObject* module)
|
||||
Base::PyExc_FC_PropertyError = PyErr_NewException("Base.PropertyError", PyExc_AttributeError, nullptr);
|
||||
Py_INCREF(Base::PyExc_FC_PropertyError);
|
||||
PyModule_AddObject(module, "PropertyError", Base::PyExc_FC_PropertyError);
|
||||
|
||||
Base::PyExc_FC_AbortIOException = PyErr_NewException("Base.PyExc_FC_AbortIOException", PyExc_BaseException, nullptr);
|
||||
Py_INCREF(Base::PyExc_FC_AbortIOException);
|
||||
PyModule_AddObject(module, "AbortIOException", Base::PyExc_FC_AbortIOException);
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
@@ -3323,7 +3327,46 @@ void Application::ExtractUserPath()
|
||||
mConfig["UserMacroPath"] = Base::FileInfo::pathToString(macro) + PATHSEP;
|
||||
}
|
||||
|
||||
#if defined (FC_OS_LINUX) || defined(FC_OS_CYGWIN) || defined(FC_OS_BSD)
|
||||
// TODO: Consider using this for all UNIX-like OSes
|
||||
#if defined(__OpenBSD__)
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <sys/param.h>
|
||||
#include <QCoreApplication>
|
||||
|
||||
std::string Application::FindHomePath(const char* sCall)
|
||||
{
|
||||
// We have three ways to start this application either use one of the two executables or
|
||||
// import the FreeCAD.so module from a running Python session. In the latter case the
|
||||
// Python interpreter is already initialized.
|
||||
std::string absPath;
|
||||
std::string homePath;
|
||||
if (Py_IsInitialized()) {
|
||||
// Note: realpath is known to cause a buffer overflow because it
|
||||
// expands the given path to an absolute path of unknown length.
|
||||
// Even setting PATH_MAX does not necessarily solve the problem
|
||||
// for sure but the risk of overflow is rather small.
|
||||
char resolved[PATH_MAX];
|
||||
char* path = realpath(sCall, resolved);
|
||||
if (path)
|
||||
absPath = path;
|
||||
}
|
||||
else {
|
||||
int argc = 1;
|
||||
QCoreApplication app(argc, (char**)(&sCall));
|
||||
absPath = QCoreApplication::applicationFilePath().toStdString();
|
||||
}
|
||||
|
||||
// should be an absolute path now
|
||||
std::string::size_type pos = absPath.find_last_of("/");
|
||||
homePath.assign(absPath,0,pos);
|
||||
pos = homePath.find_last_of("/");
|
||||
homePath.assign(homePath,0,pos+1);
|
||||
|
||||
return homePath;
|
||||
}
|
||||
|
||||
#elif defined (FC_OS_LINUX) || defined(FC_OS_CYGWIN) || defined(FC_OS_BSD)
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <sys/param.h>
|
||||
|
||||
@@ -546,10 +546,10 @@ void ComplexGeoData::readElements(Base::XMLReader& reader, size_t count)
|
||||
}
|
||||
}
|
||||
}
|
||||
_elementMap->setElementName(IndexedName(reader.getAttribute("value"), types),
|
||||
MappedName(reader.getAttribute("key")),
|
||||
Tag,
|
||||
&sids);
|
||||
ensureElementMap()->setElementName(IndexedName(reader.getAttribute("value"), types),
|
||||
MappedName(reader.getAttribute("key")),
|
||||
Tag,
|
||||
&sids);
|
||||
}
|
||||
if (invalid_count != 0) {
|
||||
FC_ERR("Found " << invalid_count << " invalid string id"); // NOLINT
|
||||
|
||||
@@ -1475,6 +1475,7 @@ Document::readObjects(Base::XMLReader& reader)
|
||||
|
||||
void Document::addRecomputeObject(DocumentObject *obj) {
|
||||
if(testStatus(Status::Restoring) && obj) {
|
||||
setStatus(Status::RecomputeOnRestore, true);
|
||||
d->touchedObjs.insert(obj);
|
||||
obj->touch();
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ public:
|
||||
RestoreError = 10,
|
||||
LinkStampChanged = 11, // Indicates during restore time if any linked document's time stamp has changed
|
||||
IgnoreErrorOnRecompute = 12, // Don't report errors if the recompute failed
|
||||
RecomputeOnRestore = 13, // Mark pending recompute on restore for migration purposes
|
||||
};
|
||||
|
||||
/** @name Properties */
|
||||
|
||||
@@ -442,6 +442,12 @@ public:
|
||||
/* Return true to cause PropertyView to show linked object's property */
|
||||
virtual bool canLinkProperties() const {return true;}
|
||||
|
||||
/* Return whether this object is a link */
|
||||
virtual bool isLink() const {return false;};
|
||||
|
||||
/* Return whether this object is a link group */
|
||||
virtual bool isLinkGroup() const {return false;};
|
||||
|
||||
/* Return true to bypass duplicate label checking */
|
||||
virtual bool allowDuplicateLabel() const {return false;}
|
||||
|
||||
|
||||
+63
-1
@@ -25,6 +25,8 @@
|
||||
|
||||
#include <App/GeoFeaturePy.h>
|
||||
|
||||
#include <Base/Tools.h>
|
||||
|
||||
#include "ComplexGeoData.h"
|
||||
#include "Document.h"
|
||||
#include "GeoFeature.h"
|
||||
@@ -157,7 +159,7 @@ DocumentObject *GeoFeature::resolveElement(DocumentObject *obj, const char *subn
|
||||
}
|
||||
if(geoFeature)
|
||||
*geoFeature = geo;
|
||||
if(!obj || (filter && obj!=filter))
|
||||
if(!obj || (filter && geo!=filter))
|
||||
return nullptr;
|
||||
if(!element || !element[0]) {
|
||||
if(append)
|
||||
@@ -270,3 +272,63 @@ GeoFeature::getHigherElements(const char *element, bool silent) const
|
||||
return {};
|
||||
return prop->getComplexData()->getHigherElements(element, silent);
|
||||
}
|
||||
|
||||
Base::Placement GeoFeature::getPlacementFromProp(App::DocumentObject* obj, const char* propName)
|
||||
{
|
||||
Base::Placement plc = Base::Placement();
|
||||
auto* propPlacement = dynamic_cast<App::PropertyPlacement*>(obj->getPropertyByName(propName));
|
||||
if (propPlacement) {
|
||||
plc = propPlacement->getValue();
|
||||
}
|
||||
return plc;
|
||||
}
|
||||
|
||||
Base::Placement GeoFeature::getGlobalPlacement(App::DocumentObject* targetObj,
|
||||
App::DocumentObject* rootObj,
|
||||
const std::string& sub)
|
||||
{
|
||||
if (!targetObj || !rootObj || sub.empty()) {
|
||||
return Base::Placement();
|
||||
}
|
||||
std::vector<std::string> names = Base::Tools::splitSubName(sub);
|
||||
|
||||
App::Document* doc = rootObj->getDocument();
|
||||
Base::Placement plc = getPlacementFromProp(rootObj, "Placement");
|
||||
|
||||
if (targetObj == rootObj) return plc;
|
||||
|
||||
for (auto& name : names) {
|
||||
App::DocumentObject* obj = doc->getObject(name.c_str());
|
||||
if (!obj) {
|
||||
return Base::Placement();
|
||||
}
|
||||
|
||||
plc = plc * getPlacementFromProp(obj, "Placement");
|
||||
|
||||
if (obj == targetObj) {
|
||||
return plc;
|
||||
}
|
||||
if (obj->isLink()) {
|
||||
// Update doc in case its an external link.
|
||||
doc = obj->getLinkedObject()->getDocument();
|
||||
}
|
||||
}
|
||||
|
||||
// If targetObj has not been found there's a problem
|
||||
return Base::Placement();
|
||||
}
|
||||
|
||||
Base::Placement GeoFeature::getGlobalPlacement(App::DocumentObject* targetObj,
|
||||
App::PropertyXLinkSub* prop)
|
||||
{
|
||||
if (!targetObj || !prop) {
|
||||
return Base::Placement();
|
||||
}
|
||||
|
||||
std::vector<std::string> subs = prop->getSubValues();
|
||||
if (subs.empty()) {
|
||||
return Base::Placement();
|
||||
}
|
||||
|
||||
return getGlobalPlacement(targetObj, prop->getValue(), subs[0]);
|
||||
}
|
||||
|
||||
@@ -179,6 +179,10 @@ public:
|
||||
/// Return the higher level element names of the given element
|
||||
virtual std::vector<Data::IndexedName> getHigherElements(const char *name, bool silent=false) const;
|
||||
|
||||
static Base::Placement getPlacementFromProp(DocumentObject* obj, const char* propName);
|
||||
static Base::Placement getGlobalPlacement(DocumentObject* targetObj, DocumentObject* rootObj, const std::string& sub);
|
||||
static Base::Placement getGlobalPlacement(DocumentObject* targetObj, PropertyXLinkSub* prop);
|
||||
|
||||
protected:
|
||||
void onChanged(const Property* prop) override;
|
||||
// void onDocumentRestored() override;
|
||||
|
||||
@@ -2282,6 +2282,16 @@ bool Link::canLinkProperties() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Link::isLink() const
|
||||
{
|
||||
return ElementCount.getValue() == 0;
|
||||
}
|
||||
|
||||
bool Link::isLinkGroup() const
|
||||
{
|
||||
return ElementCount.getValue() > 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace App {
|
||||
@@ -2309,6 +2319,11 @@ bool LinkElement::canDelete() const {
|
||||
return !owner || !owner->getDocument()->getObjectByID(_LinkOwner.getValue());
|
||||
}
|
||||
|
||||
bool LinkElement::isLink() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
App::Link* LinkElement::getLinkGroup() const
|
||||
{
|
||||
std::vector<App::DocumentObject*> inList = getInList();
|
||||
|
||||
@@ -556,6 +556,10 @@ public:
|
||||
}
|
||||
|
||||
bool canLinkProperties() const override;
|
||||
|
||||
bool isLink() const override;
|
||||
|
||||
bool isLinkGroup() const override;
|
||||
};
|
||||
|
||||
using LinkPython = App::FeaturePythonT<Link>;
|
||||
@@ -600,6 +604,8 @@ public:
|
||||
_handleChangedPropertyName(reader,TypeName,PropName);
|
||||
}
|
||||
|
||||
bool isLink() const override;
|
||||
|
||||
App::Link* getLinkGroup() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -58,7 +58,12 @@ directly. If you did not intend to use a system-defined macro
|
||||
|
||||
using namespace App;
|
||||
namespace fs = boost::filesystem;
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
#endif
|
||||
|
||||
namespace MetadataInternal
|
||||
{
|
||||
|
||||
@@ -30,7 +30,12 @@
|
||||
#include "MetadataPy.cpp"
|
||||
|
||||
using namespace Base;
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
#endif
|
||||
|
||||
// Returns a string which represents the object e.g. when printed in Python
|
||||
std::string MetadataPy::representation() const
|
||||
|
||||
@@ -56,7 +56,12 @@
|
||||
#include <Base/Stream.h>
|
||||
#include <Base/XMLTools.h>
|
||||
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
#endif
|
||||
using namespace App;
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -32,11 +32,17 @@
|
||||
#include <string>
|
||||
#include <xercesc/util/XercesDefs.hpp>
|
||||
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
namespace XERCES_CPP_NAMESPACE { class DOMNode; class DOMElement; class DOMDocument; }
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
class DOMDocument;
|
||||
class DOMElement;
|
||||
class DOMNode;
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
#endif
|
||||
|
||||
namespace App
|
||||
{
|
||||
|
||||
@@ -3018,6 +3018,17 @@ void PropertyMaterialList::setTransparency(int index, float val)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterialList::setTransparencies(const std::vector<float>& transparencies)
|
||||
{
|
||||
aboutToSetValue();
|
||||
setSize(transparencies.size(), _lValueList[0]);
|
||||
|
||||
for (std::size_t i = 0; i < transparencies.size(); i++) {
|
||||
_lValueList[i].transparency = transparencies[i];
|
||||
}
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
const Color& PropertyMaterialList::getAmbientColor() const
|
||||
{
|
||||
return _lValueList[0].ambientColor;
|
||||
|
||||
@@ -1156,6 +1156,7 @@ public:
|
||||
|
||||
void setTransparency(float);
|
||||
void setTransparency(int index, float);
|
||||
void setTransparencies(const std::vector<float>& transparencies);
|
||||
|
||||
const Color& getAmbientColor() const;
|
||||
const Color& getAmbientColor(int index) const;
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Без назвы</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Sense nom</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ které odkazují na stejný konfigurovatelný objekt</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Nepojmenovaný</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Unavngivet</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ angewendet werden soll, die das gleiche konfigurierbare Objekt referenzieren</tr
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Unbenannt</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Ανώνυμο</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ que hacen referencia al mismo objeto configurable</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Sin nombre</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Sin nombre</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Izenik gabea</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ that reference the same configurable object</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Nimetön</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Nouveau</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ na sve veze koje referenciraju isti konfigurabilni objekt</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Neimenovano</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ amelyek ugyanarra a konfigurálható tárgyra hivatkoznak</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Névtelen</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ che fanno riferimento allo stesso oggetto configurabile</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Senza nome</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>名称未設定</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>უსახელო</translation>
|
||||
</message>
|
||||
|
||||
@@ -7,14 +7,13 @@
|
||||
<location filename="../../Link.cpp" line="118"/>
|
||||
<source>Stores the last user choice of whether to apply CopyOnChange setup to all links
|
||||
that reference the same configurable object</source>
|
||||
<translation type="unfinished">Stores the last user choice of whether to apply CopyOnChange setup to all links
|
||||
that reference the same configurable object</translation>
|
||||
<translation>동일한 물체를 참조하는 모든 연결에 CopyOnChange 설정을 적용할지 사용자의 최종 선택값을 저장</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>이름없음</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Be pavadinimo</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ die verwijzen naar hetzelfde configureerbare object</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Naamloos</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ które odnoszą się do tego samego obiektu konfigurowalnego</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Nienazwany</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ que referenciam o mesmo objeto configurável</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Sem nome</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ that reference the same configurable object</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Sem nome</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ care fac referire la același obiect configurabil</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Nedenumit</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Безымянный</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ za vse povezave, ki se sklicujejo na isti nastavljivi predmet</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Neimenovan</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ that reference the same configurable object</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Bez imena</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Без имена</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ that reference the same configurable object</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Namnlös</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ uygulanmayacağına ilişkin son kullanıcı seçimini saklar</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>İsimsiz</translation>
|
||||
</message>
|
||||
@@ -24,32 +24,32 @@ uygulanmayacağına ilişkin son kullanıcı seçimini saklar</translation>
|
||||
<message>
|
||||
<location filename="../../Origin.cpp" line="142"/>
|
||||
<source>X-axis</source>
|
||||
<translation type="unfinished">X-axis</translation>
|
||||
<translation>X-ekseni</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Origin.cpp" line="143"/>
|
||||
<source>Y-axis</source>
|
||||
<translation type="unfinished">Y-axis</translation>
|
||||
<translation>Y-ekseni</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Origin.cpp" line="144"/>
|
||||
<source>Z-axis</source>
|
||||
<translation type="unfinished">Z-axis</translation>
|
||||
<translation>Z-ekseni</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Origin.cpp" line="145"/>
|
||||
<source>XY-plane</source>
|
||||
<translation type="unfinished">XY-plane</translation>
|
||||
<translation>XY-düzlemi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Origin.cpp" line="146"/>
|
||||
<source>XZ-plane</source>
|
||||
<translation type="unfinished">XZ-plane</translation>
|
||||
<translation>XZ-düzlemi</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Origin.cpp" line="147"/>
|
||||
<source>YZ-plane</source>
|
||||
<translation type="unfinished">YZ-plane</translation>
|
||||
<translation>YZ-düzlemi</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Без назви</translation>
|
||||
</message>
|
||||
|
||||
@@ -14,7 +14,7 @@ that reference the same configurable object</translation>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Sense nom</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>未命名</translation>
|
||||
</message>
|
||||
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="459"/>
|
||||
<location filename="../../Application.cpp" line="463"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>未命名</translation>
|
||||
</message>
|
||||
|
||||
@@ -35,8 +35,12 @@
|
||||
#include "InputSource.h"
|
||||
#include "XMLTools.h"
|
||||
|
||||
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
#endif
|
||||
|
||||
using namespace Base;
|
||||
using namespace std;
|
||||
|
||||
@@ -32,10 +32,18 @@
|
||||
#include <FCGlobal.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
namespace XERCES_CPP_NAMESPACE
|
||||
{
|
||||
class BinInputStream;
|
||||
}
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
class BinInputStream;
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
#endif
|
||||
|
||||
namespace Base
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#endif
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include "fmt/printf.h"
|
||||
#include <fmt/printf.h>
|
||||
|
||||
#include "Parameter.h"
|
||||
#include "Parameter.inl"
|
||||
@@ -60,8 +60,12 @@
|
||||
|
||||
FC_LOG_LEVEL_INIT("Parameter", true, true)
|
||||
|
||||
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
#endif
|
||||
using namespace Base;
|
||||
|
||||
|
||||
@@ -77,7 +81,6 @@ using namespace Base;
|
||||
// - XStr
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
|
||||
class DOMTreeErrorReporter: public ErrorHandler
|
||||
{
|
||||
public:
|
||||
|
||||
+13
-1
@@ -65,7 +65,18 @@ using PyObject = struct _object;
|
||||
#pragma warning(disable : 4275)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
namespace XERCES_CPP_NAMESPACE
|
||||
{
|
||||
class DOMNode;
|
||||
class DOMElement;
|
||||
class DOMDocument;
|
||||
class XMLFormatTarget;
|
||||
class InputSource;
|
||||
} // namespace XERCES_CPP_NAMESPACE
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
class DOMNode;
|
||||
class DOMElement;
|
||||
@@ -73,6 +84,7 @@ class DOMDocument;
|
||||
class XMLFormatTarget;
|
||||
class InputSource;
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
#endif
|
||||
|
||||
class ParameterManager;
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ PyObject* Base::PyExc_FC_ExpressionError = nullptr;
|
||||
PyObject* Base::PyExc_FC_ParserError = nullptr;
|
||||
PyObject* Base::PyExc_FC_CADKernelError = nullptr;
|
||||
PyObject* Base::PyExc_FC_PropertyError = nullptr;
|
||||
PyObject* Base::PyExc_FC_AbortIOException = nullptr;
|
||||
|
||||
typedef struct { //NOLINT
|
||||
PyObject_HEAD
|
||||
|
||||
@@ -431,6 +431,7 @@ BaseExport extern PyObject* PyExc_FC_ExpressionError;
|
||||
BaseExport extern PyObject* PyExc_FC_ParserError;
|
||||
BaseExport extern PyObject* PyExc_FC_CADKernelError;
|
||||
BaseExport extern PyObject* PyExc_FC_PropertyError;
|
||||
BaseExport extern PyObject* PyExc_FC_AbortIOException;
|
||||
|
||||
/** Exception handling for python callback functions
|
||||
* Is a convenience macro to manage the exception handling of python callback
|
||||
|
||||
+9
-1
@@ -46,8 +46,12 @@
|
||||
#include <zipios++/zipinputstream.h>
|
||||
#include <boost/iostreams/filtering_stream.hpp>
|
||||
|
||||
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -177,6 +181,8 @@ bool Base::XMLReader::read()
|
||||
void Base::XMLReader::readElement(const char* ElementName)
|
||||
{
|
||||
bool ok {};
|
||||
|
||||
endCharStream();
|
||||
int currentLevel = Level;
|
||||
std::string currentName = LocalName;
|
||||
do {
|
||||
@@ -244,6 +250,8 @@ bool Base::XMLReader::isEndOfDocument() const
|
||||
|
||||
void Base::XMLReader::readEndElement(const char* ElementName, int level)
|
||||
{
|
||||
endCharStream();
|
||||
|
||||
// if we are already at the end of the current element
|
||||
if ((ReadType == EndElement || ReadType == StartEndElement) && ElementName
|
||||
&& LocalName == ElementName && (level < 0 || level == Level)) {
|
||||
|
||||
+10
-1
@@ -42,11 +42,20 @@ namespace zipios
|
||||
{
|
||||
class ZipInputStream;
|
||||
}
|
||||
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
namespace XERCES_CPP_NAMESPACE
|
||||
{
|
||||
class DefaultHandler;
|
||||
class SAX2XMLReader;
|
||||
} // namespace XERCES_CPP_NAMESPACE
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
class DefaultHandler;
|
||||
class SAX2XMLReader;
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
#endif
|
||||
|
||||
namespace Base
|
||||
{
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="69"/>
|
||||
<source>Standard (mm, kg, s, °)</source>
|
||||
<translation type="unfinished">Standard (mm, kg, s, °)</translation>
|
||||
<translation>Estandarra (mm, kg, s, °)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="71"/>
|
||||
<source>MKS (m, kg, s, °)</source>
|
||||
<translation type="unfinished">MKS (m, kg, s, °)</translation>
|
||||
<translation>MKS (m, kg, s, °)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="73"/>
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="69"/>
|
||||
<source>Standard (mm, kg, s, °)</source>
|
||||
<translation type="unfinished">Standard (mm, kg, s, °)</translation>
|
||||
<translation>Standart (mm/kg/s/derece)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="71"/>
|
||||
<source>MKS (m, kg, s, °)</source>
|
||||
<translation type="unfinished">MKS (m, kg, s, °)</translation>
|
||||
<translation>MKS (m/kg/s/derece)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="73"/>
|
||||
@@ -36,12 +36,12 @@
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="81"/>
|
||||
<source>Metric small parts & CNC (mm, mm/min)</source>
|
||||
<translation type="unfinished">Metric small parts & CNC (mm, mm/min)</translation>
|
||||
<translation>Metrik küçük parçalar ve CNC (mm, mm/min)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="83"/>
|
||||
<source>Imperial for Civil Eng (ft, ft/s)</source>
|
||||
<translation type="unfinished">Imperial for Civil Eng (ft, ft/s)</translation>
|
||||
<translation>İngiliz Ölçü Birimi (ft, ft/sec)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="85"/>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="71"/>
|
||||
<source>MKS (m, kg, s, °)</source>
|
||||
<translation type="unfinished">MKS (m, kg, s, °)</translation>
|
||||
<translation>MKS (m, kg, s, °)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="73"/>
|
||||
@@ -36,7 +36,7 @@
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="81"/>
|
||||
<source>Metric small parts & CNC (mm, mm/min)</source>
|
||||
<translation type="unfinished">Metric small parts & CNC (mm, mm/min)</translation>
|
||||
<translation>公制小零件 & CNC (mm, mm/min)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="83"/>
|
||||
@@ -46,7 +46,7 @@
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="85"/>
|
||||
<source>FEM (mm, N, s)</source>
|
||||
<translation type="unfinished">FEM (mm, N, s)</translation>
|
||||
<translation>FEM (mm, N, s)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../UnitsApi.cpp" line="87"/>
|
||||
|
||||
@@ -372,3 +372,24 @@ std::string Base::Tools::currentDateTimeString()
|
||||
.toString(Qt::ISODate)
|
||||
.toStdString();
|
||||
}
|
||||
|
||||
std::vector<std::string> Base::Tools::splitSubName(const std::string& subname)
|
||||
{
|
||||
// Turns 'Part.Part001.Body.Pad.Edge1'
|
||||
// Into ['Part', 'Part001', 'Body', 'Pad', 'Edge1']
|
||||
std::vector<std::string> subNames;
|
||||
std::string subName;
|
||||
std::istringstream subNameStream(subname);
|
||||
while (std::getline(subNameStream, subName, '.')) {
|
||||
subNames.push_back(subName);
|
||||
}
|
||||
|
||||
// Check if the last character of the input string is the delimiter.
|
||||
// If so, add an empty string to the subNames vector.
|
||||
// Because the last subname is the element name and can be empty.
|
||||
if (!subname.empty() && subname.back() == '.') {
|
||||
subNames.push_back(""); // Append empty string for trailing dot.
|
||||
}
|
||||
|
||||
return subNames;
|
||||
}
|
||||
|
||||
@@ -325,6 +325,8 @@ struct BaseExport Tools
|
||||
static std::string joinList(const std::vector<std::string>& vec, const std::string& sep = ", ");
|
||||
|
||||
static std::string currentDateTimeString();
|
||||
|
||||
static std::vector<std::string> splitSubName(const std::string& subname);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,12 @@
|
||||
#include "XMLTools.h"
|
||||
|
||||
using namespace Base;
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
#endif
|
||||
|
||||
std::unique_ptr<XMLTranscoder> XMLTools::transcoder; // NOLINT
|
||||
|
||||
|
||||
+11
-1
@@ -31,12 +31,22 @@
|
||||
|
||||
#include <Base/Exception.h>
|
||||
|
||||
|
||||
#ifndef XERCES_CPP_NAMESPACE_BEGIN
|
||||
#define XERCES_CPP_NAMESPACE_QUALIFIER
|
||||
using namespace XERCES_CPP_NAMESPACE;
|
||||
namespace XERCES_CPP_NAMESPACE
|
||||
{
|
||||
class DOMNode;
|
||||
class DOMElement;
|
||||
class DOMDocument;
|
||||
} // namespace XERCES_CPP_NAMESPACE
|
||||
#else
|
||||
XERCES_CPP_NAMESPACE_BEGIN
|
||||
class DOMNode;
|
||||
class DOMElement;
|
||||
class DOMDocument;
|
||||
XERCES_CPP_NAMESPACE_END
|
||||
#endif
|
||||
|
||||
// Helper class
|
||||
class BaseExport XMLTools
|
||||
|
||||
@@ -18,6 +18,7 @@ Bartlomiej Niemiec
|
||||
Bas Ruigrok (Rexbas)
|
||||
bejant
|
||||
Benjamin Alterauge
|
||||
Benjamin Bræstrup Sayoc
|
||||
Bernd Hahnebach
|
||||
bgbsww
|
||||
blobfish (tanderson69)
|
||||
|
||||
@@ -28,6 +28,7 @@ configure_file(__init__.py.template ${NAMESPACE_INIT})
|
||||
|
||||
set(EXT_FILES
|
||||
freecad_doc.py
|
||||
module_io.py
|
||||
part.py
|
||||
partdesign.py
|
||||
project_utility.py
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
def OpenInsertObject(importerModule, objectPath, importMethod, docName = ""):
|
||||
try:
|
||||
importArgs = []
|
||||
importKwargs = {}
|
||||
|
||||
if docName:
|
||||
importArgs.append(docName)
|
||||
if hasattr(importerModule, "importOptions"):
|
||||
importKwargs["options"] = importerModule.importOptions(objectPath)
|
||||
|
||||
getattr(importerModule, importMethod)(objectPath, *importArgs, **importKwargs)
|
||||
except PyExc_FC_AbortIOException:
|
||||
pass
|
||||
+79
-37
@@ -81,6 +81,7 @@
|
||||
#include "PythonDebugger.h"
|
||||
#include "MainWindowPy.h"
|
||||
#include "MDIViewPy.h"
|
||||
#include "Placement.h"
|
||||
#include "SoFCDB.h"
|
||||
#include "Selection.h"
|
||||
#include "SelectionFilterPy.h"
|
||||
@@ -359,6 +360,7 @@ struct PyMethodDef FreeCADGui_methods[] = {
|
||||
|
||||
} // namespace Gui
|
||||
|
||||
// clang-format off
|
||||
Application::Application(bool GUIenabled)
|
||||
{
|
||||
// App::GetApplication().Attach(this);
|
||||
@@ -377,7 +379,6 @@ Application::Application(bool GUIenabled)
|
||||
App::GetApplication().signalShowHidden.connect(
|
||||
std::bind(&Gui::Application::slotShowHidden, this, sp::_1));
|
||||
// NOLINTEND
|
||||
|
||||
// install the last active language
|
||||
ParameterGrp::handle hPGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp");
|
||||
hPGrp = hPGrp->GetGroup("Preferences")->GetGroup("General");
|
||||
@@ -452,6 +453,10 @@ Application::Application(bool GUIenabled)
|
||||
Base::Interpreter().addType(UiLoaderPy::type_object(), module, "UiLoader");
|
||||
PyResource::init_type();
|
||||
|
||||
Gui::Dialog::TaskPlacementPy::init_type();
|
||||
Base::Interpreter().addType(Gui::Dialog::TaskPlacementPy::type_object(),
|
||||
module, "TaskPlacement");
|
||||
|
||||
// PySide additions
|
||||
PyModule_AddObject(module, "PySideUic", Base::Interpreter().addModule(new PySideUicModule));
|
||||
|
||||
@@ -555,6 +560,7 @@ Application::Application(bool GUIenabled)
|
||||
MacroCommand::load();
|
||||
}
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
Application::~Application()
|
||||
{
|
||||
@@ -589,6 +595,7 @@ Application::~Application()
|
||||
// creating std commands
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
|
||||
void Application::open(const char* FileName, const char* Module)
|
||||
{
|
||||
WaitCursor wc;
|
||||
@@ -626,22 +633,25 @@ void Application::open(const char* FileName, const char* Module)
|
||||
Command::doCommand(Command::App,
|
||||
"FreeCAD.openDocument('%s')",
|
||||
unicodepath.c_str());
|
||||
Gui::Application::checkForRecomputes();
|
||||
}
|
||||
}
|
||||
else {
|
||||
// issue module loading
|
||||
Command::doCommand(Command::App, "import %s", Module);
|
||||
|
||||
// check for additional import options
|
||||
std::stringstream str;
|
||||
str << "if hasattr(" << Module << ", \"importOptions\"):\n"
|
||||
<< " options = " << Module << ".importOptions(u\"" << unicodepath << "\")\n"
|
||||
<< " " << Module << ".open(u\"" << unicodepath << "\", options = options)\n"
|
||||
<< "else:\n"
|
||||
<< " " << Module << ".open(u\"" << unicodepath << "\")\n";
|
||||
|
||||
std::string code = str.str();
|
||||
Gui::Command::runCommand(Gui::Command::App, code.c_str());
|
||||
// Load using provided python module
|
||||
{
|
||||
Base::PyGILStateLocker locker;
|
||||
Py::Module moduleIo(PyImport_ImportModule("freecad.module_io"));
|
||||
const auto dictS = moduleIo.getDict().keys().as_string();
|
||||
if (!moduleIo.isNull() && moduleIo.hasAttr("OpenInsertObject"))
|
||||
{
|
||||
const Py::TupleN args(
|
||||
Py::Module(PyImport_ImportModule(Module)),
|
||||
Py::String(unicodepath),
|
||||
Py::String("open")
|
||||
);
|
||||
moduleIo.callMemberFunction("OpenInsertObject", args);
|
||||
}
|
||||
}
|
||||
|
||||
// ViewFit
|
||||
if (sendHasMsgToActiveView("ViewFit")) {
|
||||
@@ -706,30 +716,22 @@ void Application::importFrom(const char* FileName, const char* DocName, const ch
|
||||
}
|
||||
}
|
||||
|
||||
// check for additional import options
|
||||
std::stringstream str;
|
||||
if (DocName) {
|
||||
str << "if hasattr(" << Module << ", \"importOptions\"):\n"
|
||||
<< " options = " << Module << ".importOptions(u\"" << unicodepath
|
||||
<< "\")\n"
|
||||
<< " " << Module << ".insert(u\"" << unicodepath << "\", \"" << DocName
|
||||
<< "\", options = options)\n"
|
||||
<< "else:\n"
|
||||
<< " " << Module << ".insert(u\"" << unicodepath << "\", \"" << DocName
|
||||
<< "\")\n";
|
||||
// Load using provided python module
|
||||
{
|
||||
Base::PyGILStateLocker locker;
|
||||
Py::Module moduleIo(PyImport_ImportModule("freecad.module_io"));
|
||||
const auto dictS = moduleIo.getDict().keys().as_string();
|
||||
if (!moduleIo.isNull() && moduleIo.hasAttr("OpenInsertObject"))
|
||||
{
|
||||
const Py::TupleN args(
|
||||
Py::Module(PyImport_ImportModule(Module)),
|
||||
Py::String(unicodepath),
|
||||
Py::String("insert"),
|
||||
Py::String(DocName)
|
||||
);
|
||||
moduleIo.callMemberFunction("OpenInsertObject", args);
|
||||
}
|
||||
}
|
||||
else {
|
||||
str << "if hasattr(" << Module << ", \"importOptions\"):\n"
|
||||
<< " options = " << Module << ".importOptions(u\"" << unicodepath
|
||||
<< "\")\n"
|
||||
<< " " << Module << ".insert(u\"" << unicodepath
|
||||
<< "\", options = options)\n"
|
||||
<< "else:\n"
|
||||
<< " " << Module << ".insert(u\"" << unicodepath << "\")\n";
|
||||
}
|
||||
|
||||
std::string code = str.str();
|
||||
Gui::Command::runCommand(Gui::Command::App, code.c_str());
|
||||
|
||||
// Commit the transaction
|
||||
if (doc && !pendingCommand) {
|
||||
@@ -971,6 +973,46 @@ void Application::slotShowHidden(const App::Document& Doc)
|
||||
signalShowHidden(*doc->second);
|
||||
}
|
||||
|
||||
void Application::checkForRecomputes() {
|
||||
std::vector<App::Document *> docs;
|
||||
for (auto doc: App::GetApplication().getDocuments()) {
|
||||
if (doc->testStatus(App::Document::RecomputeOnRestore)) {
|
||||
docs.push_back(doc);
|
||||
doc->setStatus(App::Document::RecomputeOnRestore, false);
|
||||
}
|
||||
}
|
||||
// Certain tests want to use very old .FCStd files. We should not prompt during those tests, so this
|
||||
// allows them to 'FreeCAD.ConfigSet("SuppressRecomputeRequiredDialog", "True")`
|
||||
const std::map<std::string, std::string>& Map = App::Application::Config();
|
||||
auto value = Map.find("SuppressRecomputeRequiredDialog");
|
||||
bool skip = value != Map.end() && ! value->second.empty(); // Any non empty string is true.
|
||||
if (docs.empty() || skip )
|
||||
return;
|
||||
WaitCursor wc;
|
||||
wc.restoreCursor();
|
||||
auto res = QMessageBox::warning(getMainWindow(), QObject::tr("Recomputation required"),
|
||||
QObject::tr("Some document(s) require recomputation for migration purposes. "
|
||||
"It is highly recommended to perform a recomputation before "
|
||||
"any modification to avoid compatibility problems.\n\n"
|
||||
"Do you want to recompute now?"),
|
||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
|
||||
if (res != QMessageBox::Yes)
|
||||
return;
|
||||
bool hasError = false;
|
||||
for (auto doc: App::Document::getDependentDocuments(docs, true)) {
|
||||
try {
|
||||
doc->recompute({}, false, &hasError);
|
||||
} catch (Base::Exception &e) {
|
||||
e.ReportException();
|
||||
hasError = true;
|
||||
}
|
||||
}
|
||||
if (hasError)
|
||||
QMessageBox::critical(getMainWindow(), QObject::tr("Recompute error"),
|
||||
QObject::tr("Failed to recompute some document(s).\n"
|
||||
"Please check report view for more details."));
|
||||
}
|
||||
|
||||
void Application::slotActiveDocument(const App::Document& Doc)
|
||||
{
|
||||
std::map<const App::Document*, Gui::Document*>::iterator doc = d->documents.find(&Doc);
|
||||
|
||||
@@ -74,6 +74,8 @@ public:
|
||||
void exportTo(const char* FileName, const char* DocName, const char* Module);
|
||||
/// Reload a partial opened document
|
||||
App::Document *reopen(App::Document *doc);
|
||||
/// Prompt about recomputing if needed
|
||||
static void checkForRecomputes();
|
||||
//@}
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ class BitmapFactoryInstP
|
||||
public:
|
||||
QMap<std::string, const char**> xpmMap;
|
||||
QMap<std::string, QPixmap> xpmCache;
|
||||
|
||||
bool useIconTheme;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -93,7 +95,9 @@ void BitmapFactoryInst::destruct ()
|
||||
BitmapFactoryInst::BitmapFactoryInst()
|
||||
{
|
||||
d = new BitmapFactoryInstP;
|
||||
|
||||
restoreCustomPaths();
|
||||
configureUseIconTheme();
|
||||
}
|
||||
|
||||
BitmapFactoryInst::~BitmapFactoryInst()
|
||||
@@ -111,6 +115,14 @@ void BitmapFactoryInst::restoreCustomPaths()
|
||||
}
|
||||
}
|
||||
|
||||
void Gui::BitmapFactoryInst::configureUseIconTheme()
|
||||
{
|
||||
Base::Reference<ParameterGrp> group = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Bitmaps/Theme");
|
||||
|
||||
d->useIconTheme = group->GetBool("UseIconTheme", group->GetBool("ThemeSearchPaths", false));
|
||||
}
|
||||
|
||||
void BitmapFactoryInst::addPath(const QString& path)
|
||||
{
|
||||
QDir::addSearchPath(QString::fromLatin1("icons"), path);
|
||||
@@ -174,6 +186,10 @@ bool BitmapFactoryInst::findPixmapInCache(const char* name, QPixmap& px) const
|
||||
|
||||
QIcon BitmapFactoryInst::iconFromTheme(const char* name, const QIcon& fallback)
|
||||
{
|
||||
if (!d->useIconTheme) {
|
||||
return iconFromDefaultTheme(name, fallback);
|
||||
}
|
||||
|
||||
QString iconName = QString::fromUtf8(name);
|
||||
QIcon icon = QIcon::fromTheme(iconName, fallback);
|
||||
if (icon.isNull()) {
|
||||
@@ -206,6 +222,21 @@ bool BitmapFactoryInst::loadPixmap(const QString& filename, QPixmap& icon) const
|
||||
return !icon.isNull();
|
||||
}
|
||||
|
||||
QIcon Gui::BitmapFactoryInst::iconFromDefaultTheme(const char* name, const QIcon& fallback)
|
||||
{
|
||||
QIcon icon;
|
||||
QPixmap px = pixmap(name);
|
||||
|
||||
if (!px.isNull()) {
|
||||
icon.addPixmap(px);
|
||||
return icon;
|
||||
} else {
|
||||
return fallback;
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
QPixmap BitmapFactoryInst::pixmap(const char* name) const
|
||||
{
|
||||
if (!name || *name == '\0')
|
||||
|
||||
@@ -75,6 +75,10 @@ public:
|
||||
* If no such icon is found in the current theme fallback is returned instead.
|
||||
*/
|
||||
QIcon iconFromTheme(const char* name, const QIcon& fallback = QIcon());
|
||||
/** Returns the QIcon corresponding to name in the default (FreeCAD's) icon theme.
|
||||
* If no such icon is found in the current theme fallback is returned instead.
|
||||
*/
|
||||
QIcon iconFromDefaultTheme(const char* name, const QIcon& fallback = QIcon());
|
||||
/// Retrieves a pixmap by name
|
||||
QPixmap pixmap(const char* name) const;
|
||||
/** Retrieves a pixmap by name and size created by an
|
||||
@@ -150,6 +154,7 @@ public:
|
||||
private:
|
||||
bool loadPixmap(const QString& path, QPixmap&) const;
|
||||
void restoreCustomPaths();
|
||||
void configureUseIconTheme();
|
||||
|
||||
static BitmapFactoryInst* _pcSingleton;
|
||||
BitmapFactoryInst();
|
||||
|
||||
@@ -1318,7 +1318,11 @@ StdCmdDelete::StdCmdDelete()
|
||||
sWhatsThis = "Std_Delete";
|
||||
sStatusTip = QT_TR_NOOP("Deletes the selected objects");
|
||||
sPixmap = "edit-delete";
|
||||
#ifdef FC_OS_MACOSX
|
||||
sAccel = "Backspace";
|
||||
#else
|
||||
sAccel = keySequenceToAccel(QKeySequence::Delete);
|
||||
#endif
|
||||
eType = ForEdit;
|
||||
}
|
||||
|
||||
@@ -1562,6 +1566,7 @@ void StdCmdPlacement::activated(int iMsg)
|
||||
plm->setPropertyName(QLatin1String("Placement"));
|
||||
plm->setSelection(selection);
|
||||
plm->bindObject();
|
||||
plm->clearSelection();
|
||||
}
|
||||
}
|
||||
Gui::Control().showDialog(plm);
|
||||
|
||||
@@ -402,7 +402,7 @@ void DlgAddPropertyVarSet::onEditFinished() {
|
||||
checkGroup();
|
||||
checkType();
|
||||
}
|
||||
catch (const CreatePropertyException& e) {
|
||||
catch (const CreatePropertyException&) {
|
||||
if (!namePropertyToAdd.empty()) {
|
||||
clearCurrentProperty();
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>292</width>
|
||||
<height>247</height>
|
||||
<height>296</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -41,58 +41,6 @@
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="textLabel4">
|
||||
<property name="text">
|
||||
<string>Shininess:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>81</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="shininess">
|
||||
<property name="suffix">
|
||||
<string notr="true">%</string>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="textLabel1">
|
||||
<property name="text">
|
||||
@@ -100,31 +48,27 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="textLabel4">
|
||||
<property name="text">
|
||||
<string>Shininess:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Gui::ColorButton" name="ambientColor">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Gui::ColorButton" name="emissiveColor">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<property name="allowTransparency">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="textLabel3">
|
||||
<item row="6" column="0">
|
||||
<widget class="QPushButton" name="buttonReset">
|
||||
<property name="text">
|
||||
<string>Specular color:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Gui::ColorButton" name="diffuseColor">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -135,11 +79,67 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="shininess">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>122</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string notr="true">%</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Gui::ColorButton" name="emissiveColor">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="allowTransparency">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="textLabel3">
|
||||
<property name="text">
|
||||
<string>Specular color:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="Gui::ColorButton" name="specularColor">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="allowTransparency">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QPushButton" name="buttonDefault">
|
||||
<property name="text">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Gui::ColorButton" name="diffuseColor">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="allowTransparency">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
@@ -150,16 +150,25 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QPushButton" name="buttonReset">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
<string>Transparency:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QPushButton" name="buttonDefault">
|
||||
<property name="text">
|
||||
<string>Default</string>
|
||||
<widget class="QSpinBox" name="transparency">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>122</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>%</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -188,7 +197,6 @@
|
||||
<tabstop>diffuseColor</tabstop>
|
||||
<tabstop>emissiveColor</tabstop>
|
||||
<tabstop>specularColor</tabstop>
|
||||
<tabstop>shininess</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
|
||||
@@ -62,6 +62,8 @@ void DlgMaterialPropertiesImp::setupConnections()
|
||||
this, &DlgMaterialPropertiesImp::onSpecularColorChanged);
|
||||
connect(ui->shininess, qOverload<int>(&QSpinBox::valueChanged),
|
||||
this, &DlgMaterialPropertiesImp::onShininessValueChanged);
|
||||
connect(ui->transparency, qOverload<int>(&QSpinBox::valueChanged),
|
||||
this, &DlgMaterialPropertiesImp::onTransparencyValueChanged);
|
||||
connect(ui->buttonReset, &QPushButton::clicked,
|
||||
this, &DlgMaterialPropertiesImp::onButtonReset);
|
||||
connect(ui->buttonDefault, &QPushButton::clicked,
|
||||
@@ -130,6 +132,14 @@ void DlgMaterialPropertiesImp::onShininessValueChanged(int sh)
|
||||
customMaterial.shininess = (float)sh / 100.0F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the current transparency.
|
||||
*/
|
||||
void DlgMaterialPropertiesImp::onTransparencyValueChanged(int sh)
|
||||
{
|
||||
customMaterial.transparency = (float)sh / 100.0F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the colors to the Coin3D defaults
|
||||
*/
|
||||
@@ -159,6 +169,9 @@ void DlgMaterialPropertiesImp::setButtonColors(const App::Material& mat)
|
||||
ui->shininess->blockSignals(true);
|
||||
ui->shininess->setValue((int)(100.0F * (mat.shininess + 0.001F)));
|
||||
ui->shininess->blockSignals(false);
|
||||
ui->transparency->blockSignals(true);
|
||||
ui->transparency->setValue((int)(100.0F * (mat.transparency + 0.001F)));
|
||||
ui->transparency->blockSignals(false);
|
||||
}
|
||||
|
||||
#include "moc_DlgMaterialPropertiesImp.cpp"
|
||||
|
||||
@@ -63,6 +63,7 @@ private:
|
||||
void onEmissiveColorChanged();
|
||||
void onSpecularColorChanged();
|
||||
void onShininessValueChanged(int);
|
||||
void onTransparencyValueChanged(int);
|
||||
void onButtonReset();
|
||||
void onButtonDefault();
|
||||
void setButtonColors(const App::Material& mat);
|
||||
|
||||
@@ -117,6 +117,7 @@ struct DocumentP
|
||||
Connection connectStartLoadDocument;
|
||||
Connection connectFinishLoadDocument;
|
||||
Connection connectShowHidden;
|
||||
Connection connectFinishRestoreDocument;
|
||||
Connection connectFinishRestoreObject;
|
||||
Connection connectExportObjects;
|
||||
Connection connectImportObjects;
|
||||
|
||||
+16
-20
@@ -153,14 +153,19 @@ void FileDialog::accept()
|
||||
QFileDialog::accept();
|
||||
}
|
||||
|
||||
void FileDialog::getPossibleSuffixes(QStringList& possibleSuffixes, const QRegularExpression& rx,
|
||||
const QString* suffixDescriptions)
|
||||
void FileDialog::getSuffixesDescription(QStringList& suffixes, const QString* suffixDescriptions)
|
||||
{
|
||||
QRegularExpression rx;
|
||||
// start the raw string with a (
|
||||
// match a *, a . and at least one word character (a-z, A-Z, 0-9, _) with \*\.\w+
|
||||
// end the raw string with a )
|
||||
rx.setPattern(QLatin1String(R"(\*\.\w+)"));
|
||||
|
||||
QRegularExpressionMatchIterator i = rx.globalMatch(*suffixDescriptions);
|
||||
while (i.hasNext()) {
|
||||
QRegularExpressionMatch match = i.next();
|
||||
QString suffix = match.captured(1);
|
||||
possibleSuffixes << suffix;
|
||||
QString suffix = match.captured(0);
|
||||
suffixes << suffix;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,22 +200,13 @@ QString FileDialog::getSaveFileName (QWidget * parent, const QString & caption,
|
||||
filterToSearch = &filter;
|
||||
}
|
||||
|
||||
QRegularExpression rx;
|
||||
rx.setPattern(QLatin1String(R"(\s\((\*\.\w{1,})\W)"));
|
||||
QStringList possibleSuffixes;
|
||||
getPossibleSuffixes(possibleSuffixes, rx, filterToSearch);
|
||||
auto match = rx.match(*filterToSearch);
|
||||
if (match.hasMatch()) {
|
||||
int index = match.capturedStart();
|
||||
int length = match.capturedLength();
|
||||
// get the suffix with the leading dot but ignore the surrounding ' (*' and ')'
|
||||
int offsetStart = 3;
|
||||
int offsetEnd = 4;
|
||||
QString suffix = filterToSearch->mid(index + offsetStart, length - offsetEnd);
|
||||
QString fiSuffix = QLatin1String("*.") + fi.suffix(); // To match with possibleSuffixes
|
||||
if (fi.suffix().isEmpty() || !possibleSuffixes.contains(fiSuffix)) {
|
||||
dirName += suffix;
|
||||
}
|
||||
QStringList filterSuffixes;
|
||||
getSuffixesDescription(filterSuffixes, filterToSearch);
|
||||
QString fiSuffix = QLatin1String("*.") + fi.suffix(); // To match with filterSuffixes
|
||||
if (fi.suffix().isEmpty() || !filterSuffixes.contains(fiSuffix)) {
|
||||
// there is no suffix or not a suffix that matches the filter, so
|
||||
// default to the first suffix of the filter
|
||||
dirName += filterSuffixes[0].mid(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,8 +89,7 @@ private:
|
||||
bool hasSuffix(const QString&) const;
|
||||
static QList<QUrl> fetchSidebarUrls();
|
||||
static QString workingDirectory;
|
||||
static void getPossibleSuffixes(QStringList& possibleSuffixes, const QRegularExpression& rx,
|
||||
const QString* suffixDescriptions);
|
||||
static void getSuffixesDescription(QStringList& suffixes, const QString* suffixDescriptions);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 70 KiB |
+618
-632
File diff suppressed because it is too large
Load Diff
+614
-625
File diff suppressed because it is too large
Load Diff
+625
-636
File diff suppressed because it is too large
Load Diff
+616
-627
File diff suppressed because it is too large
Load Diff
+612
-623
File diff suppressed because it is too large
Load Diff
+617
-628
File diff suppressed because it is too large
Load Diff
+611
-622
File diff suppressed because it is too large
Load Diff
+621
-632
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user