Skip to content

Commit 3d6c497

Browse files
authored
Merge branch 'FreeCAD:main' into main
2 parents d371afe + 0b1d734 commit 3d6c497

File tree

927 files changed

+241618
-200393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

927 files changed

+241618
-200393
lines changed

src/3rdParty/salomesmesh/inc/MED_Wrapper.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace MED
3838
struct MEDWRAPPER_EXPORT TWrapper
3939
{
4040
typedef boost::mutex TMutex;
41-
//! This is a syncronization primitive which allow to support thread safety for the MED access
41+
//! This is a synchronization primitive which allows one to support thread safety for the MED access
4242
TMutex myMutex;
4343

4444
virtual

src/3rdParty/salomesmesh/inc/SMESH_Array1.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* The range of the index is user defined.
3030
* An array1 can be constructed with a "C array".
3131
* This functionality is useful to call methods expecting
32-
* an Array1. It allows to carry the bounds inside the arrays.
32+
* an Array1. It allows one to carry the bounds inside the arrays.
3333
*
3434
* Examples: Item tab[100]; // An example with a C array
3535
* Array1OfItem ttab (tab[0],1,100);

src/3rdParty/salomesmesh/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ bool SMDS_PolyhedralVolumeOfNodes::ChangeNodes (const vector<const SMDS_MeshNode
6969
myNodesByFaces = nodes;
7070
myQuantities = quantities;
7171

72-
// Init fields of parent class, it allows to get only unique nodes(?)
72+
// Init fields of parent class, it allows one to get only unique nodes(?)
7373

7474
set<const SMDS_MeshNode *> aSet;
7575
aSet.insert( nodes.begin(), nodes.end());

src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Cartesian_3D.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3512,7 +3512,7 @@ bool StdMeshers_Cartesian_3D::Compute(SMESH_Mesh & theMesh,
35123512
// The algorithm generates the mesh in following steps:
35133513

35143514
// 1) Intersection of grid lines with the geometry boundary.
3515-
// This step allows to find out if a given node of the initial grid is
3515+
// This step allows one to find out if a given node of the initial grid is
35163516
// inside or outside the geometry.
35173517

35183518
// 2) For each cell of the grid, check how many of it's nodes are outside

src/App/Application.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#include <Base/BaseClass.h>
6464
#include <Base/BoundBoxPy.h>
6565
#include <Base/ConsoleObserver.h>
66+
#include <Base/ServiceProvider.h>
6667
#include <Base/CoordinateSystemPy.h>
6768
#include <Base/Exception.h>
6869
#include <Base/ExceptionFactory.h>
@@ -89,6 +90,7 @@
8990
#include "Application.h"
9091
#include "CleanupProcess.h"
9192
#include "ComplexGeoData.h"
93+
#include "Services.h"
9294
#include "DocumentObjectFileIncluded.h"
9395
#include "DocumentObjectGroup.h"
9496
#include "DocumentObjectGroupPy.h"
@@ -2217,6 +2219,8 @@ void Application::initTypes()
22172219
new Base::ExceptionProducer<Base::CADKernelError>;
22182220
new Base::ExceptionProducer<Base::RestoreError>;
22192221
new Base::ExceptionProducer<Base::PropertyError>;
2222+
2223+
Base::registerServiceImplementation<CenterOfMassProvider>(new NullCenterOfMass);
22202224
}
22212225

22222226
namespace {

src/App/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ SET(FreeCADApp_CPP_SRCS
289289
MetadataPyImp.cpp
290290
ElementNamingUtils.cpp
291291
SafeMode.cpp
292+
Services.cpp
292293
StringHasher.cpp
293294
StringHasherPyImp.cpp
294295
StringIDPyImp.cpp
@@ -313,6 +314,7 @@ SET(FreeCADApp_HPP_SRCS
313314
MeasureManager.h
314315
Metadata.h
315316
ElementNamingUtils.h
317+
Services.h
316318
StringHasher.h
317319
)
318320

src/App/ComplexGeoData.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,17 @@ bool ComplexGeoData::getCenterOfGravity(Base::Vector3d& unused) const
184184
return false;
185185
}
186186

187+
std::optional<Base::Vector3d> ComplexGeoData::centerOfGravity() const
188+
{
189+
Base::Vector3d centerOfGravity;
190+
191+
if (getCenterOfGravity(centerOfGravity)) {
192+
return centerOfGravity;
193+
}
194+
195+
return {};
196+
}
197+
187198
const std::string& ComplexGeoData::elementMapPrefix()
188199
{
189200
static std::string prefix(ELEMENT_MAP_PREFIX);

src/App/ComplexGeoData.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#define APP_COMPLEX_GEO_DATA_H
2929

3030
#include <algorithm>
31+
#include <optional>
32+
3133
#include <Base/Handle.h>
3234
#include <Base/Matrix.h>
3335
#include <Base/Persistence.h>
@@ -200,6 +202,7 @@ class AppExport ComplexGeoData: public Base::Persistence, public Base::Handled
200202
* The default implementation only returns false.
201203
*/
202204
virtual bool getCenterOfGravity(Base::Vector3d& center) const;
205+
virtual std::optional<Base::Vector3d> centerOfGravity() const;
203206
//@}
204207

205208
static const std::string& elementMapPrefix();

src/App/DocumentPyImp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ PyObject* DocumentPy::addObject(PyObject* args, PyObject* kwd)
353353
str << "No document object found of type '" << sType << "'" << std::ends;
354354
throw Py::TypeError(str.str());
355355
}
356-
// Allows to hide the handling with Proxy in client python code
356+
// Allows one to hide the handling with Proxy in client python code
357357
if (obj) {
358358
try {
359359
// the python binding class to the document object

src/App/ExtensionContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Extension;
3939
* impossible to handle multiple inheritance in the C-API for python extensions. Also using multiple
4040
* parent classes in python is currently not possible with the default object approach.
4141
*
42-
* The concept of extensions allow to circumvent those problems. Extensions are FreeCAD objects
42+
* The concept of extensions allows one to circumvent those problems. Extensions are FreeCAD objects
4343
* which work like normal objects in the sense that they use properties and class methods to define
4444
* their functionality. However, they are not exposed as individual usable entities but are used to
4545
* extend other objects. A extended object gets all the properties and methods of the extension.

0 commit comments

Comments
 (0)