Add Inspection and Import WebAssembly probes
Some checks failed
FreeCAD master CI / Prepare (push) Has been cancelled
FreeCAD master CI / Pixi (push) Has been cancelled
FreeCAD master CI / Ubuntu (push) Has been cancelled
FreeCAD master CI / Windows (push) Has been cancelled
FreeCAD master CI / Lint (push) Has been cancelled
FreeCAD master CI / WrapUp (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Stale Issues / stale (push) Has been cancelled

This commit is contained in:
2026-08-21 10:57:23 +08:00
parent c87b2871be
commit a6f251f657
15 changed files with 1264 additions and 59 deletions

View File

@@ -22,7 +22,9 @@
* *
***************************************************************************/
#include <QtConcurrentMap>
#ifndef FREECAD_WEB_CORE
#include <QtConcurrentMap>
#endif
#include <boost/math/special_functions/fpclassify.hpp>
#include <cmath>
#include <iostream>
@@ -36,9 +38,9 @@
#include "PointsAlgos.h"
#ifdef _MSC_VER
# include <ppl.h>
#endif
#ifdef _MSC_VER
# include <ppl.h>
#endif
using namespace Points;
using namespace std;
@@ -84,7 +86,11 @@ Data::Segment* PointKernel::getSubElement(const char* /*Type*/, unsigned long /*
void PointKernel::transformGeometry(const Base::Matrix4D& rclMat)
{
std::vector<value_type>& kernel = getBasicPoints();
#ifdef _MSC_VER
#if defined(FREECAD_WEB_CORE)
std::for_each(kernel.begin(), kernel.end(), [rclMat](value_type& value) {
rclMat.multVec(value, value);
});
#elif defined(_MSC_VER)
// Win32-only at the moment since ppl.h is a Microsoft library. Points is not using Qt so we
// cannot use QtConcurrent We could also rewrite Points to leverage SIMD instructions Other
// option: openMP. But with VC2013 results in high CPU usage even after computation (busy-waits
@@ -92,7 +98,7 @@ void PointKernel::transformGeometry(const Base::Matrix4D& rclMat)
Concurrency::parallel_for_each(kernel.begin(), kernel.end(), [rclMat](value_type& value) {
value = rclMat * value;
});
#else
#else
QtConcurrent::blockingMap(kernel, [rclMat](value_type& value) { rclMat.multVec(value, value); });
#endif
}
@@ -101,7 +107,11 @@ void PointKernel::moveGeometry(const Base::Vector3d& vec)
{
Base::Vector3f offset = Base::toVector<float>(vec);
std::vector<value_type>& kernel = getBasicPoints();
#ifdef _MSC_VER
#if defined(FREECAD_WEB_CORE)
std::for_each(kernel.begin(), kernel.end(), [offset](value_type& value) {
value += offset;
});
#elif defined(_MSC_VER)
Concurrency::parallel_for_each(kernel.begin(), kernel.end(), [offset](value_type& value) {
value += offset;
});

View File

@@ -22,7 +22,9 @@
* *
***************************************************************************/
#include <QtConcurrentMap>
#ifndef FREECAD_WEB_CORE
#include <QtConcurrentMap>
#endif
#include <algorithm>
#include <cmath>
#include <iostream>
@@ -38,9 +40,9 @@
#include "Points.h"
#include "Properties.h"
#ifdef _MSC_VER
# include <ppl.h>
#endif
#ifdef _MSC_VER
# include <ppl.h>
#endif
using namespace Points;
@@ -383,11 +385,15 @@ void PropertyNormalList::transformGeometry(const Base::Matrix4D& mat)
aboutToSetValue();
// Rotate the normal vectors
#ifdef _MSC_VER
#if defined(FREECAD_WEB_CORE)
std::for_each(_lValueList.begin(), _lValueList.end(), [rot](Base::Vector3f& value) {
rot.multVec(value, value);
});
#elif defined(_MSC_VER)
Concurrency::parallel_for_each(_lValueList.begin(), _lValueList.end(), [rot](Base::Vector3f& value) {
value = rot * value;
});
#else
#else
QtConcurrent::blockingMap(_lValueList, [rot](Base::Vector3f& value) {
rot.multVec(value, value);
});