From b83db107cd079d4e8b840f4c4dcd3984efb1c3fb Mon Sep 17 00:00:00 2001 From: tritao Date: Sat, 8 Feb 2025 13:11:57 +0000 Subject: [PATCH] Base: Minor cleanups to base XML bindings. --- src/Base/BoundBoxPy.xml | 10 +++++----- src/Base/MatrixPy.xml | 3 ++- src/Base/QuantityPy.xml | 28 +++++++++++++--------------- src/Base/RotationPy.xml | 13 ++++++------- src/Base/TypePy.xml | 2 +- src/Base/UnitPy.xml | 17 ++++++++--------- 6 files changed, 35 insertions(+), 38 deletions(-) diff --git a/src/Base/BoundBoxPy.xml b/src/Base/BoundBoxPy.xml index 0af425be10..86e04940ba 100644 --- a/src/Base/BoundBoxPy.xml +++ b/src/Base/BoundBoxPy.xml @@ -64,7 +64,7 @@ max : Base.Vector, tuple Invalidate the bounding box. - + isValid() -> bool @@ -90,9 +90,9 @@ z : float Value to enlarge at z-direction. - + - getPoint(index) ->Base.Vector + getPoint(index) -> Base.Vector Get the point of the given index. The index must be in the range of [0, 7]. @@ -100,7 +100,7 @@ The index must be in the range of [0, 7]. index : int - + getEdge(index) -> tuple of Base.Vector @@ -110,7 +110,7 @@ The index must be in the range of [0, 11]. index : int - + closestPoint(point) -> Base.Vector closestPoint(x, y, z) -> Base.Vector diff --git a/src/Base/MatrixPy.xml b/src/Base/MatrixPy.xml index cd70049b76..e3bd475120 100644 --- a/src/Base/MatrixPy.xml +++ b/src/Base/MatrixPy.xml @@ -99,7 +99,8 @@ tol : float - decompose() -> Base.Matrix, Base.Matrix, Base.Matrix, Base.Matrix\n + decompose() -> Base.Matrix, Base.Matrix, Base.Matrix, Base.Matrix + Return a tuple of matrices representing shear, scale, rotation and move. So that matrix = move * rotation * scale * shear. diff --git a/src/Base/QuantityPy.xml b/src/Base/QuantityPy.xml index 881b58a70b..0a874e8b3d 100644 --- a/src/Base/QuantityPy.xml +++ b/src/Base/QuantityPy.xml @@ -29,38 +29,36 @@ Quantity(string) -- arbitrary mixture of numbers and chars defining a Quantity - - toStr([decimals]) - returns a string representation rounded to number of decimals. If no decimals are specified then - the internal precision is used + toStr([decimals]) + +Returns a string representation rounded to number of decimals. If no decimals are specified then +the internal precision is used - returns a quantity with the translation factor and a string with the prevered unit + Returns a quantity with the translation factor and a string with the prevered unit - - returns a floating point value as the provided unit + Returns a floating point value as the provided unit - Following parameters are allowed: - getValueAs('m/s') # unit string to parse - getValueAs(2.45,1) # translation value and unit signature - getValueAs(FreeCAD.Units.Pascal) # predefined standard units - getValueAs(Qantity('N/m^2')) # a quantity - getValueAs(Unit(0,1,0,0,0,0,0,0)) # a unit +Following parameters are allowed: +getValueAs('m/s') # unit string to parse +getValueAs(2.45,1) # translation value and unit signature +getValueAs(FreeCAD.Units.Pascal) # predefined standard units +getValueAs(Qantity('N/m^2')) # a quantity +getValueAs(Unit(0,1,0,0,0,0,0,0)) # a unit - -Return the Integral closest to x, rounding half toward even. + Returns the Integral closest to x, rounding half toward even. When an argument is passed, work like built-in round(x, ndigits). diff --git a/src/Base/RotationPy.xml b/src/Base/RotationPy.xml index 53c8a3104a..9c86e4cfe0 100644 --- a/src/Base/RotationPy.xml +++ b/src/Base/RotationPy.xml @@ -88,7 +88,7 @@ coef : sequence of float Sets the rotation to its inverse. - + inverted() -> Base.Rotation @@ -232,12 +232,11 @@ tol : float - - public: - RotationPy(const Rotation & mat, PyTypeObject *T = &Type) - :PyObjectBase(new Rotation(mat),T){} - Rotation value() const - { return *(getRotationPtr()); } + public: + RotationPy(const Rotation & mat, PyTypeObject *T = &Type) + :PyObjectBase(new Rotation(mat),T){} + Rotation value() const + { return *(getRotationPtr()); } diff --git a/src/Base/TypePy.xml b/src/Base/TypePy.xml index 25e868a6ac..f1be79b63b 100644 --- a/src/Base/TypePy.xml +++ b/src/Base/TypePy.xml @@ -19,7 +19,7 @@ namespace Base { This is the Type class BaseTypePy class. - This class provides functionality related to type management in the Base module. It's not intended for direct instantiation but for accessing type information and creating instances of various types. Instantiation is possible for classes that inherit from the Base::BaseClass class and are not abstract. +This class provides functionality related to type management in the Base module. It's not intended for direct instantiation but for accessing type information and creating instances of various types. Instantiation is possible for classes that inherit from the Base::BaseClass class and are not abstract. diff --git a/src/Base/UnitPy.xml b/src/Base/UnitPy.xml index 09ac932889..866b3536c8 100644 --- a/src/Base/UnitPy.xml +++ b/src/Base/UnitPy.xml @@ -15,16 +15,15 @@ FatherNamespace="Base"> - - Unit - defines a unit type, calculate and compare. + Unit +defines a unit type, calculate and compare. - The following constructors are supported: - Unit() -- empty constructor - Unit(i1,i2,i3,i4,i5,i6,i7,i8) -- unit signature - Unit(Quantity) -- copy unit from Quantity - Unit(Unit) -- copy constructor - Unit(string) -- parse the string for units +The following constructors are supported: +Unit() -- empty constructor +Unit(i1,i2,i3,i4,i5,i6,i7,i8) -- unit signature +Unit(Quantity) -- copy unit from Quantity +Unit(Unit) -- copy constructor +Unit(string) -- parse the string for units Unit