Remove C++ escaping from *Py.xml templates

Now all escaping required for the C++ code generation is done when the
.cpp/.h files are generated. Previously, only newlines were escaped
automatically. This was a) inconsistent and b) leaked c++ details into
the xml data.
In addition, the escaping is now done in one central place, harmonizing
the three previous implementations.

Pre-existing c++ escape sequences in the XML files have been replaced by
their literal equivalent so that the resulting python doc sting remains
unchanged.
This commit is contained in:
Jonas Bähr
2023-08-13 23:34:20 +02:00
committed by wwmayer
parent 05df2da6b4
commit 3e68d6fd50
25 changed files with 1193 additions and 600 deletions

View File

@@ -11,7 +11,8 @@
FatherNamespace="App">
<Documentation>
<Author Licence="LGPL" Name="Jürgen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<UserDocu>App.GeoFeature class.\n
<UserDocu>App.GeoFeature class.
Base class of all geometric document objects.
This class does the whole placement and position handling.
With the method `getPropertyOfGeometry` is possible to obtain
@@ -20,14 +21,16 @@ to any particular property name.</UserDocu>
</Documentation>
<Methode Name="getPaths">
<Documentation>
<UserDocu>getPaths()\n
<UserDocu>getPaths()
Returns all possible paths to the root of the document.
Note: Not implemented.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getGlobalPlacement">
<Documentation>
<UserDocu>getGlobalPlacement() -> Base.Placement\n
<UserDocu>getGlobalPlacement() -> Base.Placement
Returns the placement of the object in the global coordinate space, respecting all stacked
relationships.
Note: This function is not available during recompute, as there the placements of parents
@@ -36,7 +39,8 @@ can change after the execution of this object, rendering the result wrong.</User
</Methode>
<Methode Name="getPropertyNameOfGeometry">
<Documentation>
<UserDocu>getPropertyNameOfGeometry() -> str or None\n
<UserDocu>getPropertyNameOfGeometry() -> str or None
Returns the property name of the actual geometry.
For example for a Part feature it returns the value 'Shape', for a mesh feature the value
'Mesh' and so on.
@@ -45,7 +49,8 @@ If an object has no such property then None is returned.</UserDocu>
</Methode>
<Methode Name="getPropertyOfGeometry">
<Documentation>
<UserDocu>getPropertyOfGeometry() -> object or None\n
<UserDocu>getPropertyOfGeometry() -> object or None
Returns the property of the actual geometry.
For example for a Part feature it returns its Shape property, for a Mesh feature its
Mesh property and so on.

View File

@@ -17,21 +17,29 @@
<Documentation>
<Author Licence="LGPL" Name="Chris Hennes" EMail="chennes@pioneerlibrarysystem.org" />
<UserDocu>App.Metadata class.\n
<UserDocu>App.Metadata class.
A Metadata object reads an XML-formatted package metadata file and provides
read and write access to its contents.\n
The following constructors are supported:\n
read and write access to its contents.
The following constructors are supported:
Metadata()
Empty constructor.\n
Empty constructor.
Metadata(metadata)
Copy constructor.
metadata : App.Metadata\n
metadata : App.Metadata
Metadata(file)
Reads the XML file and provides access to the metadata it specifies.
file : str\n XML file name.\n
file : str
XML file name.
Metadata(bytes)
Treats the bytes as UTF-8-encoded XML data and provides access to the metadata it specifies.
bytes : bytes\n Python bytes-like object.</UserDocu>
bytes : bytes
Python bytes-like object.</UserDocu>
<DeveloperDocu>Metadata</DeveloperDocu>
</Documentation>
@@ -203,7 +211,8 @@ If unset it will be 0.0.0.</UserDocu>
<Methode Name="getLastSupportedFreeCADVersion">
<Documentation>
<UserDocu>getLastSupportedFreeCADVersion() -> str or None\n
<UserDocu>getLastSupportedFreeCADVersion() -> str or None
Search through all content package items, and determine if a maximum supported
version of FreeCAD is set.
Returns None if no maximum version is set, or if *any* content item fails to
@@ -214,7 +223,8 @@ known versions).</UserDocu>
<Methode Name="getFirstSupportedFreeCADVersion">
<Documentation>
<UserDocu>getFirstSupportedFreeCADVersion() -> str or None\n
<UserDocu>getFirstSupportedFreeCADVersion() -> str or None
Search through all content package items, and determine if a minimum supported
version of FreeCAD is set.
Returns 0.0 if no minimum version is set, or if *any* content item fails to
@@ -226,7 +236,8 @@ the metadata standard was added then).</UserDocu>
<Methode Name="supportsCurrentFreeCAD">
<Documentation>
<UserDocu>supportsCurrentFreeCAD() -> bool\n
<UserDocu>supportsCurrentFreeCAD() -> bool
Returns False if this metadata object directly indicates that it does not
support the current version of FreeCAD, or True if it makes no indication, or
specifically indicates that it does support the current version. Does not
@@ -236,7 +247,8 @@ recurse into Content items.</UserDocu>
<Methode Name="getGenericMetadata">
<Documentation>
<UserDocu>getGenericMetadata(name) -> list\n
<UserDocu>getGenericMetadata(name) -> list
Get the list of GenericMetadata objects with key 'name'.
Generic metadata objects are Python objects with a string 'contents' and a
dictionary of strings, 'attributes'. They represent unrecognized simple XML tags
@@ -246,151 +258,176 @@ in the metadata file.</UserDocu>
<Methode Name="addContentItem">
<Documentation>
<UserDocu>addContentItem(content_type,metadata)\n
<UserDocu>addContentItem(content_type,metadata)
Add a new content item of type 'content_type' with metadata 'metadata'. </UserDocu>
</Documentation>
</Methode>
<Methode Name="removeContentItem">
<Documentation>
<UserDocu>removeContentItem(content_type,name)\n
<UserDocu>removeContentItem(content_type,name)
Remove the content item of type 'content_type' with name 'name'. </UserDocu>
</Documentation>
</Methode>
<Methode Name="addMaintainer">
<Documentation>
<UserDocu>addMaintainer(name, email)\n
<UserDocu>addMaintainer(name, email)
Add a new Maintainer. </UserDocu>
</Documentation>
</Methode>
<Methode Name="removeMaintainer">
<Documentation>
<UserDocu>removeMaintainer(name, email)\n
<UserDocu>removeMaintainer(name, email)
Remove the Maintainer. </UserDocu>
</Documentation>
</Methode>
<Methode Name="addLicense">
<Documentation>
<UserDocu>addLicense(short_code,path)\n
<UserDocu>addLicense(short_code,path)
Add a new License. </UserDocu>
</Documentation>
</Methode>
<Methode Name="removeLicense">
<Documentation>
<UserDocu>removeLicense(short_code)\n
<UserDocu>removeLicense(short_code)
Remove the License. </UserDocu>
</Documentation>
</Methode>
<Methode Name="addUrl">
<Documentation>
<UserDocu>addUrl(url_type,url,branch)\n
Add a new Url or type 'url_type' (which should be one of 'repository', 'readme',\n
'bugtracker', 'documentation', or 'webpage') If type is 'repository' you\n
<UserDocu>addUrl(url_type,url,branch)
Add a new Url or type 'url_type' (which should be one of 'repository', 'readme',
'bugtracker', 'documentation', or 'webpage') If type is 'repository' you
must also specify the 'branch' parameter. </UserDocu>
</Documentation>
</Methode>
<Methode Name="removeUrl">
<Documentation>
<UserDocu>removeUrl(url_type,url)\n
<UserDocu>removeUrl(url_type,url)
Remove the Url. </UserDocu>
</Documentation>
</Methode>
<Methode Name="addAuthor">
<Documentation>
<UserDocu>addAuthor(name, email)\n
<UserDocu>addAuthor(name, email)
Add a new Author with name 'name', and optionally email 'email'. </UserDocu>
</Documentation>
</Methode>
<Methode Name="removeAuthor">
<Documentation>
<UserDocu>removeAuthor(name, email)\n
<UserDocu>removeAuthor(name, email)
Remove the Author. </UserDocu>
</Documentation>
</Methode>
<Methode Name="addDepend">
<Documentation>
<UserDocu>addDepend(name, kind, optional)\n
Add a new Dependency on package 'name' of kind 'kind' (optional, one of 'auto' (the default),\n
<UserDocu>addDepend(name, kind, optional)
Add a new Dependency on package 'name' of kind 'kind' (optional, one of 'auto' (the default),
'internal', 'addon', or 'python'). </UserDocu>
</Documentation>
</Methode>
<Methode Name="removeDepend">
<Documentation>
<UserDocu>removeDepend(name, kind)\n
Remove the Dependency on package 'name' of kind 'kind' (optional - if unspecified any\n
<UserDocu>removeDepend(name, kind)
Remove the Dependency on package 'name' of kind 'kind' (optional - if unspecified any
matching name is removed). </UserDocu>
</Documentation>
</Methode>
<Methode Name="addConflict">
<Documentation>
<UserDocu>addConflict(name, kind)\n
<UserDocu>addConflict(name, kind)
Add a new Conflict. See documentation for addDepend(). </UserDocu>
</Documentation>
</Methode>
<Methode Name="removeConflict">
<Documentation>
<UserDocu>removeConflict(name, kind)\n
<UserDocu>removeConflict(name, kind)
Remove the Conflict. See documentation for removeDepend().</UserDocu>
</Documentation>
</Methode>
<Methode Name="addReplace">
<Documentation>
<UserDocu>addReplace(name)\n
<UserDocu>addReplace(name)
Add a new Replace. </UserDocu>
</Documentation>
</Methode>
<Methode Name="removeReplace">
<Documentation>
<UserDocu>removeReplace(name)\n
<UserDocu>removeReplace(name)
Remove the Replace. </UserDocu>
</Documentation>
</Methode>
<Methode Name="addTag">
<Documentation>
<UserDocu>addTag(tag)\n
<UserDocu>addTag(tag)
Add a new Tag. </UserDocu>
</Documentation>
</Methode>
<Methode Name="removeTag">
<Documentation>
<UserDocu>removeTag(tag)\n
<UserDocu>removeTag(tag)
Remove the Tag. </UserDocu>
</Documentation>
</Methode>
<Methode Name="addFile">
<Documentation>
<UserDocu>addFile(filename)\n
<UserDocu>addFile(filename)
Add a new File. </UserDocu>
</Documentation>
</Methode>
<Methode Name="removeFile">
<Documentation>
<UserDocu>removeFile(filename)\n
<UserDocu>removeFile(filename)
Remove the File. </UserDocu>
</Documentation>
</Methode>
<Methode Name="write">
<Documentation>
<UserDocu>write(filename)\n
<UserDocu>write(filename)
Write the metadata to the given file as XML data.</UserDocu>
</Documentation>
</Methode>

View File

@@ -16,130 +16,182 @@
</Documentation>
<Methode Name="getPropertyByName">
<Documentation>
<UserDocu>getPropertyByName(name, checkOwner=0) -> object or Tuple\n
<UserDocu>getPropertyByName(name, checkOwner=0) -> object or Tuple
Returns the value of a named property. Note that the returned property may not
always belong to this container (e.g. from a linked object).\n
name : str\n Name of the property.
checkOwner : int\n 0: just return the property.
always belong to this container (e.g. from a linked object).
name : str
Name of the property.
checkOwner : int
0: just return the property.
1: raise exception if not found or the property does not belong to this container.
2: return a tuple (owner, propertyValue).</UserDocu>
</Documentation>
</Methode>
<Methode Name="getPropertyTouchList">
<Documentation>
<UserDocu>getPropertyTouchList(name) -> tuple\n
Returns a list of index of touched values for list type properties.\n
name : str\n Property name.</UserDocu>
<UserDocu>getPropertyTouchList(name) -> tuple
Returns a list of index of touched values for list type properties.
name : str
Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getTypeOfProperty">
<Documentation>
<UserDocu>getTypeOfProperty(name) -> list\n
<UserDocu>getTypeOfProperty(name) -> list
Returns the type of a named property. This can be a list conformed by elements in
(Hidden, NoRecompute, NoPersist, Output, ReadOnly, Transient).\n
name : str\n Property name.</UserDocu>
(Hidden, NoRecompute, NoPersist, Output, ReadOnly, Transient).
name : str
Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getTypeIdOfProperty">
<Documentation>
<UserDocu>getTypeIdOfProperty(name) -> str\n
Returns the C++ class name of a named property.\n
name : str\n Property name.</UserDocu>
<UserDocu>getTypeIdOfProperty(name) -> str
Returns the C++ class name of a named property.
name : str
Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setEditorMode">
<Documentation>
<UserDocu>setEditorMode(name, type) -> None\n
Set the behaviour of the property in the property editor.\n
name : str\n Property name.
type : int, sequence of str\n Property type.
<UserDocu>setEditorMode(name, type) -> None
Set the behaviour of the property in the property editor.
name : str
Property name.
type : int, sequence of str
Property type.
0: default behaviour. 1: item is ready-only. 2: item is hidden. 3: item is hidden and read-only.
If sequence, the available items are 'ReadOnly' and 'Hidden'.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getEditorMode">
<Documentation>
<UserDocu>getEditorMode(name) -> list\n
<UserDocu>getEditorMode(name) -> list
Get the behaviour of the property in the property editor.
It returns a list of strings with the current mode. If the list is empty there are no
special restrictions.
If the list contains 'ReadOnly' then the item appears in the property editor but is
disabled.
If the list contains 'Hidden' then the item even doesn't appear in the property editor.\n
name : str\n Property name.</UserDocu>
If the list contains 'Hidden' then the item even doesn't appear in the property editor.
name : str
Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getGroupOfProperty">
<Documentation>
<UserDocu>getGroupOfProperty(name) -> str\n
<UserDocu>getGroupOfProperty(name) -> str
Returns the name of the group which the property belongs to in this class.
The properties are sorted in different named groups for convenience.\n
name : str\n Property name.</UserDocu>
The properties are sorted in different named groups for convenience.
name : str
Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setGroupOfProperty">
<Documentation>
<UserDocu>setGroupOfProperty(name, group) -> None\n
Set the name of the group of a dynamic property.\n
name : str\n Property name.
group : str\n Group name.</UserDocu>
<UserDocu>setGroupOfProperty(name, group) -> None
Set the name of the group of a dynamic property.
name : str
Property name.
group : str
Group name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setPropertyStatus">
<Documentation>
<UserDocu>setPropertyStatus(name, val) -> None\n
Set property status.\n
name : str\n Property name.
val : int, str, sequence of str or int\n Call getPropertyStatus() to get a list of supported text value.
<UserDocu>setPropertyStatus(name, val) -> None
Set property status.
name : str
Property name.
val : int, str, sequence of str or int
Call getPropertyStatus() to get a list of supported text value.
If the text start with '-' or the integer value is negative, then the status is cleared.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getPropertyStatus">
<Documentation>
<UserDocu>getPropertyStatus(name='') -> list\n
Get property status.\n
name : str\n Property name. If empty, returns a list of supported text names of the status.</UserDocu>
<UserDocu>getPropertyStatus(name='') -> list
Get property status.
name : str
Property name. If empty, returns a list of supported text names of the status.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getDocumentationOfProperty">
<Documentation>
<UserDocu>getDocumentationOfProperty(name) -> str\n
Returns the documentation string of the property of this class.\n
name : str\n Property name.</UserDocu>
<UserDocu>getDocumentationOfProperty(name) -> str
Returns the documentation string of the property of this class.
name : str
Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setDocumentationOfProperty">
<Documentation>
<UserDocu>setDocumentationOfProperty(name, docstring) -> None\n
Set the documentation string of a dynamic property of this class.\n
name : str\n Property name.
docstring : str\n Documentation string.</UserDocu>
<UserDocu>setDocumentationOfProperty(name, docstring) -> None
Set the documentation string of a dynamic property of this class.
name : str
Property name.
docstring : str
Documentation string.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getEnumerationsOfProperty">
<Documentation>
<UserDocu>getEnumerationsOfProperty(name) -> list or None\n
<UserDocu>getEnumerationsOfProperty(name) -> list or None
Return all enumeration strings of the property of this class or None if not a
PropertyEnumeration.\n
name : str\n Property name.</UserDocu>
PropertyEnumeration.
name : str
Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="dumpPropertyContent" Keyword="true" Const="true">
<Documentation>
<UserDocu>dumpPropertyContent(Property, Compression=3) -> bytearray\n
<UserDocu>dumpPropertyContent(Property, Compression=3) -> bytearray
Dumps the content of the property, both the XML representation and the additional
data files required, into a byte representation.\n
Property : str\n Property Name.
Compression : int\n Set the data compression level in the range [0, 9]. Set to 0 for no compression.</UserDocu>
data files required, into a byte representation.
Property : str
Property Name.
Compression : int
Set the data compression level in the range [0, 9]. Set to 0 for no compression.</UserDocu>
</Documentation>
</Methode>
<Methode Name="restorePropertyContent">
<Documentation>
<UserDocu>restorePropertyContent(name, obj) -> None\n
<UserDocu>restorePropertyContent(name, obj) -> None
Restore the content of the object from a byte representation as stored by `dumpPropertyContent`.
It could be restored from any Python object implementing the buffer protocol.\n
name : str\n Property name.
obj : buffer\n Object with buffer protocol support.</UserDocu>
It could be restored from any Python object implementing the buffer protocol.
name : str
Property name.
obj : buffer
Object with buffer protocol support.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="PropertiesList" ReadOnly="true">

View File

@@ -13,14 +13,19 @@
FatherNamespace="Base">
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<UserDocu>Base.Axis class.\n
An Axis defines a direction and a position (base) in 3D space.\n
The following constructors are supported:\n
<UserDocu>Base.Axis class.
An Axis defines a direction and a position (base) in 3D space.
The following constructors are supported:
Axis()
Empty constructor.\n
Empty constructor.
Axis(axis)
Copy constructor.
axis : Base.Axis\n
axis : Base.Axis
Axis(base, direction)
Define from a position and a direction.
base : Base.Vector
@@ -29,27 +34,35 @@ direction : Base.Vector</UserDocu>
</Documentation>
<Methode Name="copy">>
<Documentation>
<UserDocu>copy() -> Base.Axis\n
<UserDocu>copy() -> Base.Axis
Returns a copy of this Axis.</UserDocu>
</Documentation>
</Methode>
<Methode Name="move">
<Documentation>
<UserDocu>move(vector) -> None\n
Move the axis base along the given vector.\n
vector : Base.Vector\n Vector by which to move the axis.</UserDocu>
<UserDocu>move(vector) -> None
Move the axis base along the given vector.
vector : Base.Vector
Vector by which to move the axis.</UserDocu>
</Documentation>
</Methode>
<Methode Name="multiply">
<Documentation>
<UserDocu>multiply(placement) -> Base.Axis\n
Multiply this axis by a placement.\n
placement : Base.Placement\n Placement by which to multiply the axis.</UserDocu>
<UserDocu>multiply(placement) -> Base.Axis
Multiply this axis by a placement.
placement : Base.Placement
Placement by which to multiply the axis.</UserDocu>
</Documentation>
</Methode>
<Methode Name="reversed">
<Documentation>
<UserDocu>reversed() -> Base.Axis\n
<UserDocu>reversed() -> Base.Axis
Compute the reversed axis. This returns a new Base.Axis with
the original direction reversed.</UserDocu>
</Documentation>

View File

@@ -14,7 +14,8 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the BoundBox export class</DeveloperDocu>
<UserDocu>Base.BoundBox class.\n
<UserDocu>Base.BoundBox class.
This class represents a bounding box.
A bounding box is a rectangular cuboid which is a way to describe outer
boundaries and is obtained from a lot of 3D types.
@@ -22,85 +23,118 @@ It is often used to check if a 3D entity lies in the range of another object.
Checking for bounding interference first can save a lot of computing time!
An invalid BoundBox is represented by inconsistent values at each direction:
The maximum float value of the system at the minimum coordinates, and the
opposite value at the maximum coordinates.\n
The following constructors are supported:\n
opposite value at the maximum coordinates.
The following constructors are supported:
BoundBox()
Empty constructor. Returns an invalid BoundBox.\n
Empty constructor. Returns an invalid BoundBox.
BoundBox(boundBox)
Copy constructor.
boundBox : Base.BoundBox\n
boundBox : Base.BoundBox
BoundBox(xMin, yMin=0, zMin=0, xMax=0, yMax=0, zMax=0)
Define from the minimum and maximum values at each direction.
xMin : float\n Minimum value at x-coordinate.
yMin : float\n Minimum value at y-coordinate.
zMin : float\n Minimum value at z-coordinate.
xMax : float\n Maximum value at x-coordinate.
yMax : float\n Maximum value at y-coordinate.
zMax : float\n Maximum value at z-coordinate.\n
xMin : float
Minimum value at x-coordinate.
yMin : float
Minimum value at y-coordinate.
zMin : float
Minimum value at z-coordinate.
xMax : float
Maximum value at x-coordinate.
yMax : float
Maximum value at y-coordinate.
zMax : float
Maximum value at z-coordinate.
App.BoundBox(min, max)
Define from two containers representing the minimum and maximum values of the
coordinates in each direction.
min : Base.Vector, tuple\n Minimum values of the coordinates.
max : Base.Vector, tuple\n Maximum values of the coordinates.</UserDocu>
min : Base.Vector, tuple
Minimum values of the coordinates.
max : Base.Vector, tuple
Maximum values of the coordinates.</UserDocu>
</Documentation>
<Methode Name="setVoid">
<Documentation>
<UserDocu>setVoid() -> None\n
<UserDocu>setVoid() -> None
Invalidate the bounding box.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isValid">
<Documentation>
<UserDocu>isValid() -> bool\n
<UserDocu>isValid() -> bool
Checks if the bounding box is valid.</UserDocu>
</Documentation>
</Methode>
<Methode Name="add">
<Documentation>
<UserDocu>add(minMax) -> None
add(x, y, z) -> None\n
add(x, y, z) -> None
Increase the maximum values or decrease the minimum values of this BoundBox by
replacing the current values with the given values, so the bounding box can grow
but not shrink.\n
minMax : Base.Vector, tuple\n Values to enlarge at each direction.
x : float\n Value to enlarge at x-direction.
y : float\n Value to enlarge at y-direction.
z : float\n Value to enlarge at z-direction.</UserDocu>
but not shrink.
minMax : Base.Vector, tuple
Values to enlarge at each direction.
x : float
Value to enlarge at x-direction.
y : float
Value to enlarge at y-direction.
z : float
Value to enlarge at z-direction.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getPoint">
<Documentation>
<UserDocu>getPoint(index) ->Base.Vector\n
<UserDocu>getPoint(index) ->Base.Vector
Get the point of the given index.
The index must be in the range of [0, 7].\n
The index must be in the range of [0, 7].
index : int</UserDocu>
</Documentation>
</Methode>
<Methode Name="getEdge">
<Documentation>
<UserDocu>getEdge(index) -> tuple of Base.Vector\n
<UserDocu>getEdge(index) -> tuple of Base.Vector
Get the edge points of the given index.
The index must be in the range of [0, 11].\n
The index must be in the range of [0, 11].
index : int</UserDocu>
</Documentation>
</Methode>
<Methode Name="closestPoint">
<Documentation>
<UserDocu>closestPoint(point) -> Base.Vector
closestPoint(x, y, z) -> Base.Vector\n
Get the closest point of the bounding box to the given point.\n
point : Base.Vector, tuple\n Coordinates of the given point.
x : float\n X-coordinate of the given point.
y : float\n Y-coordinate of the given point.
z : float\n Z-coordinate of the given point.</UserDocu>
closestPoint(x, y, z) -> Base.Vector
Get the closest point of the bounding box to the given point.
point : Base.Vector, tuple
Coordinates of the given point.
x : float
X-coordinate of the given point.
y : float
Y-coordinate of the given point.
z : float
Z-coordinate of the given point.</UserDocu>
</Documentation>
</Methode>
<Methode Name="intersect">
<Documentation>
<UserDocu>intersect(boundBox2) -> bool
intersect(base, dir) -> bool\n
intersect(base, dir) -> bool
Checks if the given object intersects with this bounding box. That can be
another bounding box or a line specified by base and direction.\n
another bounding box or a line specified by base and direction.
boundBox2 : Base.BoundBox
base : Base.Vector, tuple
dir : Base.Vector, tuple</UserDocu>
@@ -108,72 +142,100 @@ dir : Base.Vector, tuple</UserDocu>
</Methode>
<Methode Name="intersected">
<Documentation>
<UserDocu>intersected(boundBox2) -> Base.BoundBox\n
Returns the intersection of this and the given bounding box.\n
<UserDocu>intersected(boundBox2) -> Base.BoundBox
Returns the intersection of this and the given bounding box.
boundBox2 : Base.BoundBox</UserDocu>
</Documentation>
</Methode>
<Methode Name="united">
<Documentation>
<UserDocu>united(boundBox2) -> Base.BoundBox\n
Returns the union of this and the given bounding box.\n
<UserDocu>united(boundBox2) -> Base.BoundBox
Returns the union of this and the given bounding box.
boundBox2 : Base.BoundBox</UserDocu>
</Documentation>
</Methode>
<Methode Name="enlarge">
<Documentation>
<UserDocu>enlarge(variation) -> None\n
<UserDocu>enlarge(variation) -> None
Decrease the minimum values and increase the maximum values by the given value.
A negative value shrinks the bounding box.\n
A negative value shrinks the bounding box.
variation : float</UserDocu>
</Documentation>
</Methode>
<Methode Name="getIntersectionPoint">
<Documentation>
<UserDocu>getIntersectionPoint(base, dir, epsilon=0.0001) -> Base.Vector\n
<UserDocu>getIntersectionPoint(base, dir, epsilon=0.0001) -> Base.Vector
Calculate the intersection point of a line with the bounding box.
The base point must lie inside the bounding box, if not an exception is thrown.\n
base : Base.Vector\n Base point of the line.
dir : Base.Vector\n Direction of the line.
epsilon : float\n Bounding box size tolerance.</UserDocu>
The base point must lie inside the bounding box, if not an exception is thrown.
base : Base.Vector
Base point of the line.
dir : Base.Vector
Direction of the line.
epsilon : float
Bounding box size tolerance.</UserDocu>
</Documentation>
</Methode>
<Methode Name="move">
<Documentation>
<UserDocu>move(displacement) -> None
move(x, y, z) -> None\n
Move the bounding box by the given values.\n
displacement : Base.Vector, tuple\n Displacement at each direction.
x : float\n Displacement at x-direction.
y : float\n Displacement at y-direction.
z : float\n Displacement at z-direction.</UserDocu>
move(x, y, z) -> None
Move the bounding box by the given values.
displacement : Base.Vector, tuple
Displacement at each direction.
x : float
Displacement at x-direction.
y : float
Displacement at y-direction.
z : float
Displacement at z-direction.</UserDocu>
</Documentation>
</Methode>
<Methode Name="scale">
<Documentation>
<UserDocu>scale(factor) -> None
scale(x, y, z) -> None\n
Scale the bounding box by the given values.\n
factor : Base.Vector, tuple\n Factor scale at each direction.
x : float\n Scale at x-direction.
y : float\n Scale at y-direction.
z : float\n Scale at z-direction.</UserDocu>
scale(x, y, z) -> None
Scale the bounding box by the given values.
factor : Base.Vector, tuple
Factor scale at each direction.
x : float
Scale at x-direction.
y : float
Scale at y-direction.
z : float
Scale at z-direction.</UserDocu>
</Documentation>
</Methode>
<Methode Name="transformed">
<Documentation>
<UserDocu>transformed(matrix) -> Base.BoundBox\n
<UserDocu>transformed(matrix) -> Base.BoundBox
Returns a new BoundBox containing the transformed rectangular cuboid
represented by this BoundBox.\n
matrix : Base.Matrix\n Transformation matrix.</UserDocu>
represented by this BoundBox.
matrix : Base.Matrix
Transformation matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isCutPlane">
<Documentation>
<UserDocu>isCutPlane(base, normal) -> bool\n
<UserDocu>isCutPlane(base, normal) -> bool
Check if the plane specified by base and normal intersects (cuts) this bounding
box.\n
box.
base : Base.Vector
normal : Base.Vector</UserDocu>
</Documentation>
@@ -181,12 +243,18 @@ normal : Base.Vector</UserDocu>
<Methode Name="isInside">
<Documentation>
<UserDocu>isInside(object) -> bool
isInside(x, y, z) -> bool\n
Check if a point or a bounding box is inside this bounding box.\n
object : Base.Vector, Base.BoundBox\n Object to check if it is inside this bounding box.
x : float\n X-coordinate of the point to check.
y : float\n Y-coordinate of the point to check.
z : float\n Z-coordinate of the point to check.</UserDocu>
isInside(x, y, z) -> bool
Check if a point or a bounding box is inside this bounding box.
object : Base.Vector, Base.BoundBox
Object to check if it is inside this bounding box.
x : float
X-coordinate of the point to check.
y : float
Y-coordinate of the point to check.
z : float
Z-coordinate of the point to check.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Center" ReadOnly="true">

View File

@@ -14,46 +14,58 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the CoordinateSystem export class</DeveloperDocu>
<UserDocu>Base.CoordinateSystem class.\n
An orthonormal right-handed coordinate system in 3D space.\n
<UserDocu>Base.CoordinateSystem class.
An orthonormal right-handed coordinate system in 3D space.
CoordinateSystem()
Empty constructor.</UserDocu>
</Documentation>
<Methode Name="setAxes">
<Documentation>
<UserDocu>setAxes(axis, xDir) -> None\n
<UserDocu>setAxes(axis, xDir) -> None
Set axis or Z-direction, and X-direction.
The X-direction is determined from the orthonormal compononent of `xDir`
with respect to `axis` direction.\n
with respect to `axis` direction.
axis : Base.Axis, Base.Vector
xDir : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="displacement" Const="true">
<Documentation>
<UserDocu>displacement(coordSystem2) -> Base.Placement\n
Computes the placement from this to the passed coordinate system `coordSystem2`.\n
<UserDocu>displacement(coordSystem2) -> Base.Placement
Computes the placement from this to the passed coordinate system `coordSystem2`.
coordSystem2 : Base.CoordinateSystem</UserDocu>
</Documentation>
</Methode>
<Methode Name="transformTo">
<Documentation>
<UserDocu>transformTo(vector) -> Base.Vector\n
Computes the coordinates of the point in coordinates of this coordinate system.\n
<UserDocu>transformTo(vector) -> Base.Vector
Computes the coordinates of the point in coordinates of this coordinate system.
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="transform">
<Documentation>
<UserDocu>transform(trans) -> None\n
Applies a transformation on this coordinate system.\n
<UserDocu>transform(trans) -> None
Applies a transformation on this coordinate system.
trans : Base.Rotation, Base.Placement</UserDocu>
</Documentation>
</Methode>
<Methode Name="setPlacement">
<Documentation>
<UserDocu>setPlacment(placement) -> None\n
Set placement to the coordinate system.\n
<UserDocu>setPlacment(placement) -> None
Set placement to the coordinate system.
placement : Base.Placement</UserDocu>
</Documentation>
</Methode>

View File

@@ -16,23 +16,30 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the Matrix export class</DeveloperDocu>
<UserDocu>Base.Matrix class.\n
<UserDocu>Base.Matrix class.
A 4x4 Matrix.
In particular, this matrix can represent an affine transformation, that is,
given a 3D vector `x`, apply the transformation y = M*x + b, where the matrix
`M` is a linear map and the vector `b` is a translation.
`y` can be obtained using a linear transformation represented by the 4x4 matrix
`A` conformed by the augmented 3x4 matrix (M|b), augmented by row with
(0,0,0,1), therefore: (y, 1) = A*(x, 1).\n
The following constructors are supported:\n
(0,0,0,1), therefore: (y, 1) = A*(x, 1).
The following constructors are supported:
Matrix()
Empty constructor.\n
Empty constructor.
Matrix(matrix)
Copy constructor.
matrix : Base.Matrix.\n
matrix : Base.Matrix.
Matrix(*coef)
Define from 16 coefficients of the 4x4 matrix.
coef : sequence of float\n The sequence can have up to 16 elements which complete the matrix by rows.\n
coef : sequence of float
The sequence can have up to 16 elements which complete the matrix by rows.
Matrix(vector1, vector2, vector3, vector4)
Define from four 3D vectors which represent the columns of the 3x4 submatrix,
useful to represent an affine transformation. The fourth row is made up by
@@ -40,212 +47,272 @@ useful to represent an affine transformation. The fourth row is made up by
vector1 : Base.Vector
vector2 : Base.Vector
vector3 : Base.Vector
vector4 : Base.Vector\n Default to (0,0,0). Optional.</UserDocu>
vector4 : Base.Vector
Default to (0,0,0). Optional.</UserDocu>
</Documentation>
<Methode Name="move">
<Documentation>
<UserDocu>move(vector) -> None
move(x, y, z) -> None\n
move(x, y, z) -> None
Move the matrix along a vector, equivalent to left multiply the matrix
by a pure translation transformation.\n
by a pure translation transformation.
vector : Base.Vector, tuple
x : float\n `x` translation.
y : float\n `y` translation.
z : float\n `z` translation.</UserDocu>
x : float
`x` translation.
y : float
`y` translation.
z : float
`z` translation.</UserDocu>
</Documentation>
</Methode>
<Methode Name="scale">
<Documentation>
<UserDocu>scale(vector) -> None
scale(x, y, z) -> None
scale(factor) -> None\n
Scale the first three rows of the matrix.\n
scale(factor) -> None
Scale the first three rows of the matrix.
vector : Base.Vector
x : float\n First row factor scale.
y : float\n Second row factor scale.
z : float\n Third row factor scale.
factor : float\n global factor scale.</UserDocu>
x : float
First row factor scale.
y : float
Second row factor scale.
z : float
Third row factor scale.
factor : float
global factor scale.</UserDocu>
</Documentation>
</Methode>
<Methode Name="hasScale" Const="true">
<Documentation>
<UserDocu>hasScale(tol=0) -> ScaleType\n
<UserDocu>hasScale(tol=0) -> ScaleType
Return an enum value of ScaleType. Possible values are:
Uniform, NonUniformLeft, NonUniformRight, NoScaling or Other
if it's not a scale matrix.\n
if it's not a scale matrix.
tol : float</UserDocu>
</Documentation>
</Methode>
<Methode Name="nullify">
<Documentation>
<UserDocu>nullify() -> None\n
<UserDocu>nullify() -> None
Make this the null matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isNull" Const="true">
<Documentation>
<UserDocu>isNull() -> bool\n
<UserDocu>isNull() -> bool
Check if this is the null matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="unity">
<Documentation>
<UserDocu>unity() -> None\n
<UserDocu>unity() -> None
Make this matrix to unity (4D identity matrix).</UserDocu>
</Documentation>
</Methode>
<Methode Name="isUnity" Const="true">
<Documentation>
<UserDocu>isUnity() -> bool\n
<UserDocu>isUnity() -> bool
Check if this is the unit matrix (4D identity matrix).</UserDocu>
</Documentation>
</Methode>
<Methode Name="transform">
<Documentation>
<UserDocu>transform(vector, matrix2) -> None\n
<UserDocu>transform(vector, matrix2) -> None
Transform the matrix around a given point.
Equivalent to left multiply the matrix by T*M*T_inv, where M is `matrix2`, T the
translation generated by `vector` and T_inv the inverse translation.
For example, if `matrix2` is a rotation, the result is the transformation generated
by the current matrix followed by a rotation around the point represented by `vector`.\n
by the current matrix followed by a rotation around the point represented by `vector`.
vector : Base.Vector
matrix2 : Base.Matrix</UserDocu>
</Documentation>
</Methode>
<Methode Name="col" Const="true">
<Documentation>
<UserDocu>col(index) -> Base.Vector\n
<UserDocu>col(index) -> Base.Vector
Return the vector of a column, that is, the vector generated by the three
first elements of the specified column.\n
index : int\n Required column index.</UserDocu>
first elements of the specified column.
index : int
Required column index.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setCol">
<Documentation>
<UserDocu>setCol(index, vector) -> None\n
<UserDocu>setCol(index, vector) -> None
Set the vector of a column, that is, the three first elements of the specified
column by index.\n
index : int\n Required column index.
column by index.
index : int
Required column index.
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="row" Const="true">
<Documentation>
<UserDocu>row(index) -> Base.Vector\n
<UserDocu>row(index) -> Base.Vector
Return the vector of a row, that is, the vector generated by the three
first elements of the specified row.\n
index : int\n Required row index.</UserDocu>
first elements of the specified row.
index : int
Required row index.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setRow">
<Documentation>
<UserDocu>setRow(index, vector) -> None\n
<UserDocu>setRow(index, vector) -> None
Set the vector of a row, that is, the three first elements of the specified
row by index.\n
index : int\n Required row index.
row by index.
index : int
Required row index.
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="trace" Const="true">
<Documentation>
<UserDocu>trace() -> Base.Vector\n
<UserDocu>trace() -> Base.Vector
Return the diagonal of the 3x3 leading principal submatrix as vector.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setTrace">
<Documentation>
<UserDocu>setTrace(vector) -> None\n
Set the diagonal of the 3x3 leading principal submatrix.\n
<UserDocu>setTrace(vector) -> None
Set the diagonal of the 3x3 leading principal submatrix.
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="rotateX">
<Documentation>
<UserDocu>rotateX(angle) -> None\n
Rotate around X axis.\n
angle : float\n Angle in radians.</UserDocu>
<UserDocu>rotateX(angle) -> None
Rotate around X axis.
angle : float
Angle in radians.</UserDocu>
</Documentation>
</Methode>
<Methode Name="rotateY">
<Documentation>
<UserDocu>rotateY(angle) -> None\n
Rotate around Y axis.\n
angle : float\n Angle in radians.</UserDocu>
<UserDocu>rotateY(angle) -> None
Rotate around Y axis.
angle : float
Angle in radians.</UserDocu>
</Documentation>
</Methode>
<Methode Name="rotateZ">
<Documentation>
<UserDocu>rotateZ(angle) -> None\n
Rotate around Z axis.\n
angle : float\n Angle in radians.</UserDocu>
<UserDocu>rotateZ(angle) -> None
Rotate around Z axis.
angle : float
Angle in radians.</UserDocu>
</Documentation>
</Methode>
<Methode Name="multiply" Const="true">
<Documentation>
<UserDocu>multiply(matrix) -> Base.Matrix
multiply(vector) -> Base.Vector\n
multiply(vector) -> Base.Vector
Right multiply the matrix by the given object.
If the argument is a vector, this is augmented to the 4D vector (`vector`, 1).\n
If the argument is a vector, this is augmented to the 4D vector (`vector`, 1).
matrix : Base.Matrix
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="multVec" Const="true">
<Documentation>
<UserDocu>multVec(vector) -> Base.Vector\n
Compute the transformed vector using the matrix.\n
<UserDocu>multVec(vector) -> Base.Vector
Compute the transformed vector using the matrix.
vector : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="invert">
<Documentation>
<UserDocu>invert() -> None\n
<UserDocu>invert() -> None
Compute the inverse matrix in-place, if possible.</UserDocu>
</Documentation>
</Methode>
<Methode Name="inverse" Const="true">
<Documentation><UserDocu>inverse() -> Base.Matrix\n
<Documentation><UserDocu>inverse() -> Base.Matrix
Compute the inverse matrix, if possible.</UserDocu>
</Documentation>
</Methode>
<Methode Name="transpose">
<Documentation>
<UserDocu>transpose() -> None\n
<UserDocu>transpose() -> None
Transpose the matrix in-place.</UserDocu>
</Documentation>
</Methode>
<Methode Name="transposed" Const="true">
<Documentation>
<UserDocu>transposed() -> Base.Matrix\n
<UserDocu>transposed() -> Base.Matrix
Returns a transposed copy of this matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="determinant" Const="true">
<Documentation>
<UserDocu>determinant() -> float\n
<UserDocu>determinant() -> float
Compute the determinant of the matrix.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isOrthogonal" Const="true">
<Documentation>
<UserDocu>isOrthogonal(tol=1e-6) -> float\n
<UserDocu>isOrthogonal(tol=1e-6) -> float
Checks if the matrix is orthogonal, i.e. M * M^T = k*I and returns
the multiple of the identity matrix. If it's not orthogonal 0 is returned.\n
tol : float\n Tolerance used to check orthogonality.</UserDocu>
the multiple of the identity matrix. If it's not orthogonal 0 is returned.
tol : float
Tolerance used to check orthogonality.</UserDocu>
</Documentation>
</Methode>
<Methode Name="submatrix" Const="true">
<Documentation>
<UserDocu>submatrix(dim) -> Base.Matrix\n
<UserDocu>submatrix(dim) -> Base.Matrix
Get the leading principal submatrix of the given dimension.
The (4 - `dim`) remaining dimensions are completed with the
corresponding identity matrix.\n
dim : int\n Dimension parameter must be in the range [1,4].</UserDocu>
corresponding identity matrix.
dim : int
Dimension parameter must be in the range [1,4].</UserDocu>
</Documentation>
</Methode>
<Methode Name="analyze" Const="true">
<Documentation>
<UserDocu>analyze() -> str\n
<UserDocu>analyze() -> str
Analyzes the type of transformation.</UserDocu>
</Documentation>
</Methode>

View File

@@ -12,7 +12,8 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the Persistence class</DeveloperDocu>
<UserDocu>Base.Persistence class.\n
<UserDocu>Base.Persistence class.
Class to dump and restore the content of an object.</UserDocu>
</Documentation>
<Attribute Name="Content" ReadOnly="true">
@@ -29,18 +30,24 @@ Class to dump and restore the content of an object.</UserDocu>
</Attribute>
<Methode Name="dumpContent" Keyword="true" Const="true">
<Documentation>
<UserDocu>dumpContent(Compression=3) -> bytearray\n
<UserDocu>dumpContent(Compression=3) -> bytearray
Dumps the content of the object, both the XML representation and the additional
data files required, into a byte representation.\n
Compression : int\n Set the data compression level in the range [0,9]. Set to 0 for no compression.</UserDocu>
data files required, into a byte representation.
Compression : int
Set the data compression level in the range [0,9]. Set to 0 for no compression.</UserDocu>
</Documentation>
</Methode>
<Methode Name="restoreContent">
<Documentation>
<UserDocu>restoreContent(obj) -> None\n
<UserDocu>restoreContent(obj) -> None
Restore the content of the object from a byte representation as stored by `dumpContent`.
It could be restored from any Python object implementing the buffer protocol.\n
obj : buffer\n Object with buffer protocol support.</UserDocu>
It could be restored from any Python object implementing the buffer protocol.
obj : buffer
Object with buffer protocol support.</UserDocu>
</Documentation>
</Methode>
</PythonExport>

View File

@@ -15,27 +15,35 @@
FatherNamespace="Base">
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<UserDocu>Base.Placement class.\n
<UserDocu>Base.Placement class.
A Placement defines an orientation (rotation) and a position (base) in 3D space.
It is used when no scaling or other distortion is needed.\n
The following constructors are supported:\n
It is used when no scaling or other distortion is needed.
The following constructors are supported:
Placement()
Empty constructor.\n
Empty constructor.
Placement(placement)
Copy constructor.
placement : Base.Placement\n
placement : Base.Placement
Placement(matrix)
Define from a 4D matrix consisting of rotation and translation.
matrix : Base.Matrix\n
matrix : Base.Matrix
Placement(base, rotation)
Define from position and rotation.
base : Base.Vector
rotation : Base.Rotation\n
rotation : Base.Rotation
Placement(base, rotation, center)
Define from position and rotation with center.
base : Base.Vector
rotation : Base.Rotation
center : Base.Vector\n
center : Base.Vector
Placement(base, axis, angle)
define position and rotation.
base : Base.Vector
@@ -45,115 +53,149 @@ angle : float</UserDocu>
</Documentation>
<Methode Name="copy" Const="true">
<Documentation>
<UserDocu>copy() -> Base.Placement\n
<UserDocu>copy() -> Base.Placement
Returns a copy of this placement.</UserDocu>
</Documentation>
</Methode>
<Methode Name="move">
<Documentation>
<UserDocu>move(vector) -> None\n
Move the placement along a vector.\n
vector : Base.Vector\n Vector by which to move the placement.</UserDocu>
<UserDocu>move(vector) -> None
Move the placement along a vector.
vector : Base.Vector
Vector by which to move the placement.</UserDocu>
</Documentation>
</Methode>
<Methode Name="translate">
<Documentation>
<UserDocu>translate(vector) -> None\n
Alias to move(), to be compatible with TopoShape.translate().\n
vector : Base.Vector\n Vector by which to move the placement.</UserDocu>
<UserDocu>translate(vector) -> None
Alias to move(), to be compatible with TopoShape.translate().
vector : Base.Vector
Vector by which to move the placement.</UserDocu>
</Documentation>
</Methode>
<Methode Name="rotate" Keyword="true">
<Documentation>
<UserDocu>rotate(center, axis, angle, comp) -> None\n
<UserDocu>rotate(center, axis, angle, comp) -> None
Rotate the current placement around center and axis with the given angle.
This method is compatible with TopoShape.rotate() if the (optional) keyword
argument comp is True (default=False).
center : Base.Vector, sequence of float\n Rotation center.
axis : Base.Vector, sequence of float\n Rotation axis.
angle : float\n Rotation angle in degrees.
comp : bool\n optional keyword only argument, if True (default=False),
center : Base.Vector, sequence of float
Rotation center.
axis : Base.Vector, sequence of float
Rotation axis.
angle : float
Rotation angle in degrees.
comp : bool
optional keyword only argument, if True (default=False),
behave like TopoShape.rotate() (i.e. the resulting placements are interchangeable).
</UserDocu>
</Documentation>
</Methode>
<Methode Name="multiply" Const="true">
<Documentation>
<UserDocu>multiply(placement) -> Base.Placement\n
<UserDocu>multiply(placement) -> Base.Placement
Right multiply this placement with another placement.
Also available as `*` operator.\n
placement : Base.Placement\n Placement by which to multiply this placement.</UserDocu>
Also available as `*` operator.
placement : Base.Placement
Placement by which to multiply this placement.</UserDocu>
</Documentation>
</Methode>
<Methode Name="multVec" Const="true">
<Documentation>
<UserDocu>multVec(vector) -> Base.Vector\n
Compute the transformed vector using the placement.\n
vector : Base.Vector\n Vector to be transformed.</UserDocu>
<UserDocu>multVec(vector) -> Base.Vector
Compute the transformed vector using the placement.
vector : Base.Vector
Vector to be transformed.</UserDocu>
</Documentation>
</Methode>
<Methode Name="toMatrix" Const="true">
<Documentation>
<UserDocu>toMatrix() -> Base.Matrix\n
<UserDocu>toMatrix() -> Base.Matrix
Compute the matrix representation of the placement.</UserDocu>
</Documentation>
</Methode>
<Methode Name="inverse" Const="true">
<Documentation>
<UserDocu>inverse() -> Base.Placement\n
<UserDocu>inverse() -> Base.Placement
Compute the inverse placement.</UserDocu>
</Documentation>
</Methode>
<Methode Name="pow" Const="true">
<Documentation>
<UserDocu>pow(t, shorten=True) -> Base.Placement\n
<UserDocu>pow(t, shorten=True) -> Base.Placement
Raise this placement to real power using ScLERP interpolation.
Also available as `**` operator.\n
t : float\n Real power.
shorten : bool\n If True, ensures rotation quaternion is net positive to make
Also available as `**` operator.
t : float
Real power.
shorten : bool
If True, ensures rotation quaternion is net positive to make
the path shorter.</UserDocu>
</Documentation>
</Methode>
<Methode Name="sclerp" Const="true">
<Documentation>
<UserDocu>sclerp(placement2, t, shorten=True) -> Base.Placement\n
<UserDocu>sclerp(placement2, t, shorten=True) -> Base.Placement
Screw Linear Interpolation (ScLERP) between this placement and `placement2`.
Interpolation is a continuous motion along a helical path parametrized by `t`
made of equal transforms if discretized.
If quaternions of rotations of the two placements differ in sign, the interpolation
will take a long path.\n
will take a long path.
placement2 : Base.Placement
t : float\n Parameter of helical path. t=0 returns this placement, t=1 returns
t : float
Parameter of helical path. t=0 returns this placement, t=1 returns
`placement2`. t can also be outside of [0, 1] range for extrapolation.
shorten : bool\n If True, the signs are harmonized before interpolation and the interpolation
shorten : bool
If True, the signs are harmonized before interpolation and the interpolation
takes the shorter path.</UserDocu>
</Documentation>
</Methode>
<Methode Name="slerp" Const="true">
<Documentation>
<UserDocu>slerp(placement2, t) -> Base.Placement\n
<UserDocu>slerp(placement2, t) -> Base.Placement
Spherical Linear Interpolation (SLERP) between this placement and `placement2`.
This function performs independent interpolation of rotation and movement.
Result of such interpolation might be not what application expects, thus this tool
might be considered for simple cases or for interpolating between small intervals.
For more complex cases you better use the advanced sclerp() function.\n
For more complex cases you better use the advanced sclerp() function.
placement2 : Base.Placement
t : float\n Parameter of the path. t=0 returns this placement, t=1 returns `placement2`.</UserDocu>
t : float
Parameter of the path. t=0 returns this placement, t=1 returns `placement2`.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isIdentity" Const="true">
<Documentation>
<UserDocu>isIdentity([tol=0.0]) -> bool\n
<UserDocu>isIdentity([tol=0.0]) -> bool
Returns True if the placement has no displacement and no rotation.
Matrix representation is the 4D identity matrix.
tol : float\n Tolerance used to check for identity.
tol : float
Tolerance used to check for identity.
If tol is negative or zero, no tolerance is used.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isSame" Const="true">
<Documentation>
<UserDocu>isSame(Base.Placement, [tol=0.0]) -> bool\n
<UserDocu>isSame(Base.Placement, [tol=0.0]) -> bool
Checks whether this and the given placement are the same.
The default tolerance is set to 0.0</UserDocu>
</Documentation>

View File

@@ -16,42 +16,52 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the Rotation export class</DeveloperDocu>
<UserDocu>Base.Rotation class.\n
A Rotation using a quaternion.\n
The following constructors are supported:\n
<UserDocu>Base.Rotation class.
A Rotation using a quaternion.
The following constructors are supported:
Rotation()
Empty constructor.\n
Empty constructor.
Rotation(rotation)
Copy constructor.\n
Copy constructor.
Rotation(Axis, Radian)
Rotation(Axis, Degree)
Define from an axis and an angle (in radians or degrees according to the keyword).
Axis : Base.Vector
Radian : float
Degree : float\n
Degree : float
Rotation(vector_start, vector_end)
Define from two vectors (rotation from/to vector).
vector_start : Base.Vector
vector_end : Base.Vector\n
vector_end : Base.Vector
Rotation(angle1, angle2, angle3)
Define from three floats (Euler angles) as yaw-pitch-roll in XY'Z'' convention.
angle1 : float
angle2 : float
angle3 : float\n
angle3 : float
Rotation(seq, angle1, angle2, angle3)
Define from one string and three floats (Euler angles) as Euler rotation
of a given type. Call toEulerAngles() for supported sequence types.
seq : str
angle1 : float
angle2 : float
angle3 : float\n
angle3 : float
Rotation(x, y, z, w)
Define from four floats (quaternion) where the quaternion is specified as:
q = xi+yj+zk+w, i.e. the last parameter is the real part.
x : float
y : float
z : float
w : float\n
w : float
Rotation(dir1, dir2, dir3, seq)
Define from three vectors that define rotated axes directions plus an optional
3-characher string of capital letters 'X', 'Y', 'Z' that sets the order of
@@ -60,10 +70,12 @@ x is used but corrected if necessary, y is ignored).
dir1 : Base.Vector
dir2 : Base.Vector
dir3 : Base.Vector
seq : str\n
seq : str
Rotation(matrix)
Define from a matrix rotation in the 4D representation.
matrix : Base.Matrix\n
matrix : Base.Matrix
Rotation(*coef)
Define from 16 or 9 elements which represent the rotation in the 4D matrix
representation or in the 3D matrix representation, respectively.
@@ -71,68 +83,91 @@ coef : sequence of float</UserDocu>
</Documentation>
<Methode Name="invert">
<Documentation>
<UserDocu>invert() -> None\n
<UserDocu>invert() -> None
Sets the rotation to its inverse.</UserDocu>
</Documentation>
</Methode>
<Methode Name="inverted">
<Documentation>
<UserDocu>inverted() -> Base.Rotation\n
<UserDocu>inverted() -> Base.Rotation
Returns the inverse of the rotation.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isSame">
<Documentation>
<UserDocu>isSame(rotation, tol=0) -> bool\n
Checks if `rotation` perform the same transformation as this rotation.\n
<UserDocu>isSame(rotation, tol=0) -> bool
Checks if `rotation` perform the same transformation as this rotation.
rotation : Base.Rotation
tol : float\n Tolerance used to compare both rotations.
tol : float
Tolerance used to compare both rotations.
If tol is negative or zero, no tolerance is used.</UserDocu>
</Documentation>
</Methode>
<Methode Name="multiply" Const="true">
<Documentation>
<UserDocu>multiply(rotation) -> Base.Rotation\n
Right multiply this rotation with another rotation.\n
rotation : Base.Rotation\n Rotation by which to multiply this rotation.</UserDocu>
<UserDocu>multiply(rotation) -> Base.Rotation
Right multiply this rotation with another rotation.
rotation : Base.Rotation
Rotation by which to multiply this rotation.</UserDocu>
</Documentation>
</Methode>
<Methode Name="multVec" Const="true">
<Documentation>
<UserDocu>multVec(vector) -> Base.Vector\n
Compute the transformed vector using the rotation.\n
vector : Base.Vector\n Vector to be transformed.</UserDocu>
<UserDocu>multVec(vector) -> Base.Vector
Compute the transformed vector using the rotation.
vector : Base.Vector
Vector to be transformed.</UserDocu>
</Documentation>
</Methode>
<Methode Name="slerp" Const="true">
<Documentation>
<UserDocu>slerp(rotation2, t) -> Base.Rotation\n
Spherical Linear Interpolation (SLERP) of this rotation and `rotation2`.\n
t : float\n Parameter of the path. t=0 returns this rotation, t=1 returns `rotation2`.</UserDocu>
<UserDocu>slerp(rotation2, t) -> Base.Rotation
Spherical Linear Interpolation (SLERP) of this rotation and `rotation2`.
t : float
Parameter of the path. t=0 returns this rotation, t=1 returns `rotation2`.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setYawPitchRoll">
<Documentation>
<UserDocu>setYawPitchRoll(angle1, angle2, angle3) -> None\n
Set the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.\n
angle1 : float\n Angle around yaw axis in degrees.
angle2 : float\n Angle around pitch axis in degrees.
angle3 : float\n Angle around roll axis in degrees.</UserDocu>
<UserDocu>setYawPitchRoll(angle1, angle2, angle3) -> None
Set the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.
angle1 : float
Angle around yaw axis in degrees.
angle2 : float
Angle around pitch axis in degrees.
angle3 : float
Angle around roll axis in degrees.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getYawPitchRoll" Const="true">
<Documentation>
<UserDocu>getYawPitchRoll() -> tuple\n
<UserDocu>getYawPitchRoll() -> tuple
Get the Euler angles of this rotation as yaw-pitch-roll in XY'Z'' convention.
The angles are given in degrees.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setEulerAngles">
<Documentation>
<UserDocu>setEulerAngles(seq, angle1, angle2, angle3) -> None\n
<UserDocu>setEulerAngles(seq, angle1, angle2, angle3) -> None
Set the Euler angles in a given sequence for this rotation.
The angles must be given in degrees.\n
seq : str\n Euler sequence name. All possible values given by toEulerAngles().
The angles must be given in degrees.
seq : str
Euler sequence name. All possible values given by toEulerAngles().
angle1 : float
angle2 : float
angle3 : float </UserDocu>
@@ -140,29 +175,36 @@ angle3 : float </UserDocu>
</Methode>
<Methode Name="toEulerAngles" Const="true">
<Documentation>
<UserDocu>toEulerAngles(seq) -> list\n
Get the Euler angles in a given sequence for this rotation.\n
seq : str\n Euler sequence name. If not given, the function returns
<UserDocu>toEulerAngles(seq) -> list
Get the Euler angles in a given sequence for this rotation.
seq : str
Euler sequence name. If not given, the function returns
all possible values of `seq`. Optional.</UserDocu>
</Documentation>
</Methode>
<Methode Name="toMatrix" Const="true">
<Documentation>
<UserDocu>toMatrix() -> Base.Matrix\n
<UserDocu>toMatrix() -> Base.Matrix
Convert the rotation to a 4D matrix representation.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isNull" Const="true">
<Documentation>
<UserDocu>isNull() -> bool\n
<UserDocu>isNull() -> bool
Returns True if all values in the quaternion representation are zero.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isIdentity" Const="true">
<Documentation>
<UserDocu>isIdentity(tol=0) -> bool\n
<UserDocu>isIdentity(tol=0) -> bool
Returns True if the rotation equals the 4D identity matrix.
tol : float\n Tolerance used to check for identity.
tol : float
Tolerance used to check for identity.
If tol is negative or zero, no tolerance is used.</UserDocu>
</Documentation>
</Methode>

View File

@@ -17,7 +17,8 @@ namespace Base {
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the Type class</DeveloperDocu>
<UserDocu>Base.BaseType class.\n
<UserDocu>Base.BaseType class.
This class is not intended to create instances of itself, but to get information
from the different types and create instances of them.
Regarding instantiation, this is possible in cases that inherit from the
@@ -25,74 +26,91 @@ Base::BaseClass class and are not abstract classes.</UserDocu>
</Documentation>
<Methode Name="fromName" Static="true">
<Documentation>
<UserDocu>fromName(name) -> Base.BaseType\n
Returns a type object by name.\n
<UserDocu>fromName(name) -> Base.BaseType
Returns a type object by name.
name : str</UserDocu>
</Documentation>
</Methode>
<Methode Name="fromKey" Static="true">
<Documentation>
<UserDocu>fromKey(key) -> Base.BaseType\n
Returns a type id object by key.\n
<UserDocu>fromKey(key) -> Base.BaseType
Returns a type id object by key.
key : int</UserDocu>
</Documentation>
</Methode>
<Methode Name="getNumTypes" Static="true">
<Documentation>
<UserDocu>getNumTypes() -> int\n
<UserDocu>getNumTypes() -> int
Returns the number of type ids created so far.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getBadType" Static="true">
<Documentation>
<UserDocu>getBadType() -> Base.BaseType\n
<UserDocu>getBadType() -> Base.BaseType
Returns an invalid type id.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getAllDerivedFrom" Static="true">
<Documentation>
<UserDocu>getAllDerivedFrom(type) -> list\n
Returns all descendants from the given type id.\n
<UserDocu>getAllDerivedFrom(type) -> list
Returns all descendants from the given type id.
type : str, Base.BaseType</UserDocu>
</Documentation>
</Methode>
<Methode Name="getParent" Const="true">
<Documentation>
<UserDocu>getParent() -> Base.BaseType\n
<UserDocu>getParent() -> Base.BaseType
Returns the parent type id.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isBad" Const="true">
<Documentation>
<UserDocu>isBad() -> bool\n
<UserDocu>isBad() -> bool
Checks if the type id is invalid.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isDerivedFrom" Const="true">
<Documentation>
<UserDocu>isDerivedFrom(type) -> bool\n
Returns true if given type id is a father of this type id.\n
<UserDocu>isDerivedFrom(type) -> bool
Returns true if given type id is a father of this type id.
type : str, Base.BaseType</UserDocu>
</Documentation>
</Methode>
<Methode Name="getAllDerived" Const="true">
<Documentation>
<UserDocu>getAllDerived() -> list\n
<UserDocu>getAllDerived() -> list
Returns all descendants from this type id.</UserDocu>
</Documentation>
</Methode>
<Methode Name="createInstance">
<Documentation>
<UserDocu>createInstance() -> object\n
<UserDocu>createInstance() -> object
Creates an instance of this type id.</UserDocu>
</Documentation>
</Methode>
<Methode Name="createInstanceByName" Static="true">
<Documentation>
<UserDocu>createInstanceByName(name, load=False) -> object\n
Creates an instance of the named type id.\n
<UserDocu>createInstanceByName(name, load=False) -> object
Creates an instance of the named type id.
name : str
load : bool\n Load named type id module.</UserDocu>
load : bool
Load named type id module.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Name" ReadOnly="true">

View File

@@ -16,162 +16,203 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<DeveloperDocu>This is the Vector export class</DeveloperDocu>
<UserDocu>Base.Vector class.\n
<UserDocu>Base.Vector class.
This class represents a 3D float vector.
Useful to represent points in the 3D space.\n
The following constructors are supported:\n
Useful to represent points in the 3D space.
The following constructors are supported:
Vector(x=0, y=0, z=0)
x : float
y : float
z : float\n
z : float
Vector(vector)
Copy constructor.
vector : Base.Vector\n
vector : Base.Vector
Vector(seq)
Define from a sequence of float.
seq : sequence of float.</UserDocu>
</Documentation>
<Methode Name="__reduce__" Const="true">
<Documentation>
<UserDocu>__reduce__() -> tuple\n
<UserDocu>__reduce__() -> tuple
Serialization of Vector objects.</UserDocu>
</Documentation>
</Methode>
<Methode Name="add" Const="true">
<Documentation>
<UserDocu>add(vector2) -> Base.Vector\n
Returns the sum of this vector and `vector2`.\n
<UserDocu>add(vector2) -> Base.Vector
Returns the sum of this vector and `vector2`.
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="sub" Const="true">
<Documentation>
<UserDocu>sub(vector2) -> Base.Vector\n
Returns the difference of this vector and `vector2`.\n
<UserDocu>sub(vector2) -> Base.Vector
Returns the difference of this vector and `vector2`.
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="negative" Const="true">
<Documentation>
<UserDocu>negative() -> Base.Vector\n
<UserDocu>negative() -> Base.Vector
Returns the negative (opposite) of this vector.</UserDocu>
</Documentation>
</Methode>
<Methode Name="scale">
<Documentation>
<UserDocu>scale(x, y, z) -> Base.Vector\n
Scales in-place this vector by the given factor in each component.\n
x : float\n x-component factor scale.
y : float\n y-component factor scale.
z : float\n z-component factor scale.</UserDocu>
<UserDocu>scale(x, y, z) -> Base.Vector
Scales in-place this vector by the given factor in each component.
x : float
x-component factor scale.
y : float
y-component factor scale.
z : float
z-component factor scale.</UserDocu>
</Documentation>
</Methode>
<Methode Name="multiply">
<Documentation>
<UserDocu>multiply(factor) -> Base.Vector\n
<UserDocu>multiply(factor) -> Base.Vector
Multiplies in-place each component of this vector by a single factor.
Equivalent to scale(factor, factor, factor).\n
Equivalent to scale(factor, factor, factor).
factor : float</UserDocu>
</Documentation>
</Methode>
<Methode Name="dot" Const="true">
<Documentation>
<UserDocu>dot(vector2) -> float\n
Returns the scalar product (dot product) between this vector and `vector2`.\n
<UserDocu>dot(vector2) -> float
Returns the scalar product (dot product) between this vector and `vector2`.
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="cross" Const="true">
<Documentation>
<UserDocu>cross(vector2) -> Base.Vector\n
Returns the vector product (cross product) between this vector and `vector2`.\n
<UserDocu>cross(vector2) -> Base.Vector
Returns the vector product (cross product) between this vector and `vector2`.
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="isOnLineSegment" Const="true">
<Documentation>
<UserDocu>isOnLineSegment(vector1, vector2) -> bool\n
Checks if this vector is on the line segment generated by `vector1` and `vector2`.\n
<UserDocu>isOnLineSegment(vector1, vector2) -> bool
Checks if this vector is on the line segment generated by `vector1` and `vector2`.
vector1 : Base.Vector
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="getAngle" Const="true">
<Documentation>
<UserDocu>getAngle(vector2) -> float\n
Returns the angle in radians between this vector and `vector2`.\n
<UserDocu>getAngle(vector2) -> float
Returns the angle in radians between this vector and `vector2`.
vector2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="normalize">
<Documentation>
<UserDocu>normalize() -> Base.Vector\n
<UserDocu>normalize() -> Base.Vector
Normalizes in-place this vector to the length of 1.0.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isEqual" Const="true">
<Documentation>
<UserDocu>isEqual(vector2, tol=0) -> bool\n
<UserDocu>isEqual(vector2, tol=0) -> bool
Checks if the distance between the points represented by this vector
and `vector2` is less or equal to the given tolerance.\n
and `vector2` is less or equal to the given tolerance.
vector2 : Base.Vector
tol : float</UserDocu>
</Documentation>
</Methode>
<Methode Name="projectToLine">
<Documentation>
<UserDocu>projectToLine(point, dir) -> Base.Vector\n
<UserDocu>projectToLine(point, dir) -> Base.Vector
Projects `point` on a line that goes through the origin with the direction `dir`.
The result is the vector from `point` to the projected point.
The operation is equivalent to dir_n.cross(dir_n.cross(point)), where `dir_n` is
the vector `dir` normalized.
The method modifies this vector instance according to result and does not
depend on the vector itself.\n
depend on the vector itself.
point : Base.Vector
dir : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="projectToPlane">
<Documentation>
<UserDocu>projectToPlane(base, normal) -> Base.Vector\n
<UserDocu>projectToPlane(base, normal) -> Base.Vector
Projects in-place this vector on a plane defined by a base point
represented by `base` and a normal defined by `normal`.\n
represented by `base` and a normal defined by `normal`.
base : Base.Vector
normal : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="distanceToPoint" Const="true">
<Documentation>
<UserDocu>distanceToPoint(point2) -> float\n
Returns the distance to another point represented by `point2`.\n.
<UserDocu>distanceToPoint(point2) -> float
Returns the distance to another point represented by `point2`.
.
point : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="distanceToLine" Const="true">
<Documentation>
<UserDocu>distanceToLine(base, dir) -> float\n
<UserDocu>distanceToLine(base, dir) -> float
Returns the distance between the point represented by this vector
and a line defined by a base point represented by `base` and a
direction `dir`.\n
direction `dir`.
base : Base.Vector
dir : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="distanceToLineSegment" Const="true">
<Documentation>
<UserDocu>distanceToLineSegment(point1, point2) -> Base.Vector\n
<UserDocu>distanceToLineSegment(point1, point2) -> Base.Vector
Returns the vector between the point represented by this vector and the point
on the line segment with the shortest distance. The line segment is defined by
`point1` and `point2`.\n
`point1` and `point2`.
point1 : Base.Vector
point2 : Base.Vector</UserDocu>
</Documentation>
</Methode>
<Methode Name="distanceToPlane" Const="true">
<Documentation>
<UserDocu>distanceToPlane(base, normal) -> float\n
<UserDocu>distanceToPlane(base, normal) -> float
Returns the distance between this vector and a plane defined by a
base point represented by `base` and a normal defined by `normal`.\n
base point represented by `base` and a normal defined by `normal`.
base : Base.Vector
normal : Base.Vector</UserDocu>
</Documentation>

View File

@@ -13,23 +13,30 @@
Delete="true">
<Documentation>
<Author Licence="LGPL" Name="Zheng, Lei" EMail="realthunder.dev@gmail.com" />
<UserDocu>Gui.AxisOrigin class.\n
<UserDocu>Gui.AxisOrigin class.
Class for creating a Coin3D representation of a coordinate system.</UserDocu>
</Documentation>
<Methode Name="getElementPicked" Const="true">
<Documentation>
<UserDocu>getElementPicked(pickedPoint) -> str\n
Returns the picked element name.\n
<UserDocu>getElementPicked(pickedPoint) -> str
Returns the picked element name.
pickedPoint : coin.SoPickedPoint</UserDocu>
</Documentation>
</Methode>
<Methode Name="getDetailPath" Const="true">
<Documentation>
<UserDocu>getDetailPath(subname, path) -> coin.SoDetail or None\n
<UserDocu>getDetailPath(subname, path) -> coin.SoDetail or None
Returns Coin detail of a subelement.
Note: Not fully implemented. Currently only returns None.\n
subname : str\n String reference to the subelement.
path: coin.SoPath\n Output Coin path leading to the returned element detail.</UserDocu>
Note: Not fully implemented. Currently only returns None.
subname : str
String reference to the subelement.
path: coin.SoPath
Output Coin path leading to the returned element detail.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="AxisLength">

View File

@@ -15,107 +15,142 @@
</Documentation>
<Methode Name="get" Static='true'>
<Documentation>
<UserDocu>get(name) -> Gui.Command or None\n
Get a given command by name or None if it doesn't exist.\n
name : str\n Command name.</UserDocu>
<UserDocu>get(name) -> Gui.Command or None
Get a given command by name or None if it doesn't exist.
name : str
Command name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="update" Static='true'>
<Documentation>
<UserDocu>update() -> None\n
<UserDocu>update() -> None
Update active status of all commands.</UserDocu>
</Documentation>
</Methode>
<Methode Name="listAll" Static='true'>
<Documentation>
<UserDocu>listAll() -> list of str\n
<UserDocu>listAll() -> list of str
Returns the name of all commands.</UserDocu>
</Documentation>
</Methode>
<Methode Name="listByShortcut" Static='true'>
<Documentation>
<UserDocu>listByShortcut(string, useRegExp=False) -> list of str\n
<UserDocu>listByShortcut(string, useRegExp=False) -> list of str
Returns a list of all commands, filtered by shortcut.
Shortcuts are converted to uppercase and spaces removed
prior to comparison.\n
string : str\n Shortcut to be searched.
useRegExp : bool\n Filter using regular expression.</UserDocu>
prior to comparison.
string : str
Shortcut to be searched.
useRegExp : bool
Filter using regular expression.</UserDocu>
</Documentation>
</Methode>
<Methode Name="run">
<Documentation>
<UserDocu>run(item=0) -> None\n
Runs the given command.\n
item : int\n Item to be run.</UserDocu>
<UserDocu>run(item=0) -> None
Runs the given command.
item : int
Item to be run.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isActive" Const="true">
<Documentation>
<UserDocu>isActive() -> bool\n
<UserDocu>isActive() -> bool
Returns True if the command is active, False otherwise.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getShortcut">
<Documentation>
<UserDocu>getShortcut() -> str\n
<UserDocu>getShortcut() -> str
Returns string representing shortcut key accelerator for command.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setShortcut">
<Documentation>
<UserDocu>setShortcut(string) -> bool\n
Sets shortcut for given command, returns True for success.\n
string : str\n Shortcut to be set.</UserDocu>
<UserDocu>setShortcut(string) -> bool
Sets shortcut for given command, returns True for success.
string : str
Shortcut to be set.</UserDocu>
</Documentation>
</Methode>
<Methode Name="resetShortcut">
<Documentation>
<UserDocu>resetShortcut() -> bool\n
<UserDocu>resetShortcut() -> bool
Resets shortcut for given command back to the default, returns True for success.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getInfo">
<Documentation>
<UserDocu>getInfo() -> dict\n
<UserDocu>getInfo() -> dict
Return information about this command.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getAction">
<Documentation>
<UserDocu>getAction() -> list of QAction\n
<UserDocu>getAction() -> list of QAction
Return the associated QAction object.</UserDocu>
</Documentation>
</Methode>
<Methode Name="createCustomCommand" Static='true' Keyword='true'>
<Documentation>
<UserDocu>createCustomCommand(macroFile, menuText, toolTip, whatsThis, statusTip, pixmap, shortcut) -> str\n
Create a custom command for a macro. Returns name of the created command.\n
macroFile : str\n Macro file.
menuText : str\n Menu text. Optional.
toolTip : str\n Tool tip text. Optional.
whatsThis : str\n `What's this?` text. Optional.
statusTip : str\n Status tip text. Optional.
pixmap : str\n Pixmap name. Optional.
shortcut : str\n Shortcut key sequence. Optional.</UserDocu>
<UserDocu>createCustomCommand(macroFile, menuText, toolTip, whatsThis, statusTip, pixmap, shortcut) -> str
Create a custom command for a macro. Returns name of the created command.
macroFile : str
Macro file.
menuText : str
Menu text. Optional.
toolTip : str
Tool tip text. Optional.
whatsThis : str
`What's this?` text. Optional.
statusTip : str
Status tip text. Optional.
pixmap : str
Pixmap name. Optional.
shortcut : str
Shortcut key sequence. Optional.</UserDocu>
</Documentation>
</Methode>
<Methode Name="removeCustomCommand" Static='true'>
<Documentation>
<UserDocu>removeCustomCommand(name) -> bool\n
<UserDocu>removeCustomCommand(name) -> bool
Remove the custom command if it exists.
Given the name of a custom command, this removes that command.
It is not an error to remove a non-existent command, the function
simply does nothing in that case.
Returns True if something was removed, or False if not.\n
name : str\n Command name.</UserDocu>
Returns True if something was removed, or False if not.
name : str
Command name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="findCustomCommand" Static='true'>
<Documentation>
<UserDocu>findCustomCommand(name) -> str or None\n
<UserDocu>findCustomCommand(name) -> str or None
Given the name of a macro, return the name of the custom command for that macro
or None if there is no command matching that macro script name.\n
name : str\n Macro name.</UserDocu>
or None if there is no command matching that macro script name.
name : str
Macro name.</UserDocu>
</Documentation>
</Methode>
</PythonExport>

View File

@@ -15,135 +15,183 @@
</Documentation>
<Methode Name="show">
<Documentation>
<UserDocu>show(objName) -> None\n
Show an object.\n
objName : str\n Name of the `Gui.ViewProvider` to show.</UserDocu>
<UserDocu>show(objName) -> None
Show an object.
objName : str
Name of the `Gui.ViewProvider` to show.</UserDocu>
</Documentation>
</Methode>
<Methode Name="hide">
<Documentation>
<UserDocu>hide(objName) -> None\n
Hide an object.\n
objName : str\n Name of the `Gui.ViewProvider` to hide.</UserDocu>
<UserDocu>hide(objName) -> None
Hide an object.
objName : str
Name of the `Gui.ViewProvider` to hide.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setPos">
<Documentation>
<UserDocu>setPos(objName, matrix) -> None\n
Set the position of an object.\n
objName : str\n Name of the `Gui.ViewProvider`.\n
matrix : Base.Matrix\n Transformation to apply on the object.</UserDocu>
<UserDocu>setPos(objName, matrix) -> None
Set the position of an object.
objName : str
Name of the `Gui.ViewProvider`.
matrix : Base.Matrix
Transformation to apply on the object.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setEdit">
<Documentation>
<UserDocu>setEdit(obj, mod=0, subName) -> bool\n
Set an object in edit mode.\n
obj : str, App.DocumentObject, Gui.ViewPrivider\n Object to set in edit mode.
mod : int\n Edit mode.
subName : str\n Subelement name. Optional.</UserDocu>
<UserDocu>setEdit(obj, mod=0, subName) -> bool
Set an object in edit mode.
obj : str, App.DocumentObject, Gui.ViewPrivider
Object to set in edit mode.
mod : int
Edit mode.
subName : str
Subelement name. Optional.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getInEdit">
<Documentation>
<UserDocu>getInEdit() -> Gui.ViewProviderDocumentObject or None\n
<UserDocu>getInEdit() -> Gui.ViewProviderDocumentObject or None
Returns the current object in edit mode or None if there is no such object.</UserDocu>
</Documentation>
</Methode>
<Methode Name="resetEdit">
<Documentation>
<UserDocu>resetEdit() -> None\n
<UserDocu>resetEdit() -> None
End the current editing.</UserDocu>
</Documentation>
</Methode>
<Methode Name="addAnnotation">
<Documentation>
<UserDocu>addAnnotation(annoName, fileName, modName) -> None\n
Add an Inventor object from a file.\n
annoName : str\n Annotation name.
fileName : str\n File name.
modName : str\n Display mode name. Optional.</UserDocu>
<UserDocu>addAnnotation(annoName, fileName, modName) -> None
Add an Inventor object from a file.
annoName : str
Annotation name.
fileName : str
File name.
modName : str
Display mode name. Optional.</UserDocu>
</Documentation>
</Methode>
<Methode Name="update">
<Documentation>
<UserDocu>update() -> None\n
<UserDocu>update() -> None
Update the view representations of all objects.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getObject">
<Documentation>
<UserDocu>getObject(objName) -> object or None\n
Return the object with the given name. If no one exists, return None.\n
ObjName : str\n Object name.</UserDocu>
<UserDocu>getObject(objName) -> object or None
Return the object with the given name. If no one exists, return None.
ObjName : str
Object name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="activeObject">
<Documentation>
<UserDocu>activeObject() -> object or None\n
<UserDocu>activeObject() -> object or None
The active object of the document. Deprecated, use ActiveObject.</UserDocu>
</Documentation>
</Methode>
<Methode Name="activeView">
<Documentation>
<UserDocu>activeView() -> object or None\n
<UserDocu>activeView() -> object or None
The active view of the document. Deprecated, use ActiveView.</UserDocu>
</Documentation>
</Methode>
<Methode Name="mdiViewsOfType" Const="true">
<Documentation>
<UserDocu>mdiViewsOfType(type) -> list of MDIView\n
Return a list of mdi views of a given type.\n
type : str\n Type name.</UserDocu>
<UserDocu>mdiViewsOfType(type) -> list of MDIView
Return a list of mdi views of a given type.
type : str
Type name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="save">
<Documentation>
<UserDocu>save() -> bool\n
<UserDocu>save() -> bool
Attempts to save the document</UserDocu>
</Documentation>
</Methode>
<Methode Name="saveAs">
<Documentation>
<UserDocu>saveAs() -> bool\n
<UserDocu>saveAs() -> bool
Attempts to save the document under a new name</UserDocu>
</Documentation>
</Methode>
<Methode Name="sendMsgToViews">
<Documentation>
<UserDocu>sendMsgToViews(msg) -> None\n
Send a message to all views of the document.\n
<UserDocu>sendMsgToViews(msg) -> None
Send a message to all views of the document.
msg : str</UserDocu>
</Documentation>
</Methode>
<Methode Name="mergeProject">
<Documentation>
<UserDocu>mergeProject(fileName) -> None\n
Merges this document with another project file.\n
fileName : str\n File name.</UserDocu>
<UserDocu>mergeProject(fileName) -> None
Merges this document with another project file.
fileName : str
File name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="toggleTreeItem">
<Documentation>
<UserDocu>toggleTreeItem(obj, mod=0, subName) -> None\n
Change TreeItem of a document object.\n
<UserDocu>toggleTreeItem(obj, mod=0, subName) -> None
Change TreeItem of a document object.
obj : App.DocumentObject
mod : int\n Item mode.
mod : int
Item mode.
0: Toggle, 1: Collapse, 2: Expand, 3: Expand path.
subName : str\n Subelement name. Optional.</UserDocu>
subName : str
Subelement name. Optional.</UserDocu>
</Documentation>
</Methode>
<Methode Name="scrollToTreeItem">
<Documentation>
<UserDocu>scrollToTreeItem(obj) -> None\n
Scroll the tree view to the item of a view object.\n
<UserDocu>scrollToTreeItem(obj) -> None
Scroll the tree view to the item of a view object.
obj : Gui.ViewProviderDocumentObject</UserDocu>
</Documentation>
</Methode>
<Methode Name="toggleInSceneGraph">
<Documentation>
<UserDocu>toggleInSceneGraph(obj) -> None\n
Add or remove view object from scene graph of all views depending\non its canAddToSceneGraph().\n
<UserDocu>toggleInSceneGraph(obj) -> None
Add or remove view object from scene graph of all views depending
on its canAddToSceneGraph().
obj : Gui.ViewProvider</UserDocu>
</Documentation>
</Methode>

View File

@@ -15,195 +15,268 @@
</Documentation>
<Methode Name="addProperty">
<Documentation>
<UserDocu>addProperty(type, name, group, doc, attr=0, ro=False, hd=False) -> ViewProvider\n
Add a generic property.\n
type : str\n Property type.
name : str\n Property name. Optional.
group : str\n Property group. Optional.
attr : int\n Property attributes.
ro : bool\n Read only property.
hd : bool\n Hidden property.</UserDocu>
<UserDocu>addProperty(type, name, group, doc, attr=0, ro=False, hd=False) -> ViewProvider
Add a generic property.
type : str
Property type.
name : str
Property name. Optional.
group : str
Property group. Optional.
attr : int
Property attributes.
ro : bool
Read only property.
hd : bool
Hidden property.</UserDocu>
</Documentation>
</Methode>
<Methode Name="removeProperty">
<Documentation>
<UserDocu>removeProperty(name) -> bool\n
<UserDocu>removeProperty(name) -> bool
Remove a generic property.
Only user-defined properties can be removed, not built-in ones.\n
name : str\n Property name.</UserDocu>
Only user-defined properties can be removed, not built-in ones.
name : str
Property name.</UserDocu>
</Documentation>
</Methode>
<Methode Name="supportedProperties">
<Documentation>
<UserDocu>supportedProperties() -> list\n
<UserDocu>supportedProperties() -> list
A list of supported property types.</UserDocu>
</Documentation>
</Methode>
<Methode Name="show">
<Documentation>
<UserDocu>show() -> None\n
<UserDocu>show() -> None
Show the object.</UserDocu>
</Documentation>
</Methode>
<Methode Name="hide">
<Documentation>
<UserDocu>show() -> None\n
<UserDocu>show() -> None
Hide the object.</UserDocu>
</Documentation>
</Methode>
<Methode Name="isVisible">
<Documentation>
<UserDocu>isVisible() -> bool\n
<UserDocu>isVisible() -> bool
Check if the object is visible.</UserDocu>
</Documentation>
</Methode>
<Methode Name="canDragObject">
<Documentation>
<UserDocu>canDragObject(obj=None) -> bool\n
<UserDocu>canDragObject(obj=None) -> bool
Check whether the child object can be removed by dragging.
If 'obj' is not given, check without filter by any particular object.\n
obj : App.DocumentObject\n Object to be dragged.</UserDocu>
If 'obj' is not given, check without filter by any particular object.
obj : App.DocumentObject
Object to be dragged.</UserDocu>
</Documentation>
</Methode>
<Methode Name="dragObject">
<Documentation>
<UserDocu>dragObject(obj) -> None\n
Remove a child object by dropping.\n
obj : App.DocumentObject\n Object to be dragged.</UserDocu>
<UserDocu>dragObject(obj) -> None
Remove a child object by dropping.
obj : App.DocumentObject
Object to be dragged.</UserDocu>
</Documentation>
</Methode>
<Methode Name="canDropObject" Keyword="true">
<Documentation>
<UserDocu>canDropObject(obj=None, owner=None, subname, elem=None) -> bool\n
<UserDocu>canDropObject(obj=None, owner=None, subname, elem=None) -> bool
Check whether the child object can be added by dropping.
If 'obj' is not given, check without filter by any particular object.\n
obj : App.DocumentObject\n Object to be dropped.
owner : App.DocumentObject\n Parent object of the dropping object.
subname : str\n Subname reference to the dropping object. Optional.
elem : sequence of str\n Non-objects subelements selected when the object is
If 'obj' is not given, check without filter by any particular object.
obj : App.DocumentObject
Object to be dropped.
owner : App.DocumentObject
Parent object of the dropping object.
subname : str
Subname reference to the dropping object. Optional.
elem : sequence of str
Non-objects subelements selected when the object is
being dropped.</UserDocu>
</Documentation>
</Methode>
<Methode Name="dropObject" Keyword="true">
<Documentation>
<UserDocu>dropObject(obj, owner=None, subname, elem=None) -> str\n
Add a child object by dropping.\n
obj : App.DocumentObject\n Object to be dropped.
owner : App.DocumentObject\n Parent object of the dropping object.
subname : str\n Subname reference to the dropping object. Optional.
elem : sequence of str\n Non-objects subelements selected when the object is
<UserDocu>dropObject(obj, owner=None, subname, elem=None) -> str
Add a child object by dropping.
obj : App.DocumentObject
Object to be dropped.
owner : App.DocumentObject
Parent object of the dropping object.
subname : str
Subname reference to the dropping object. Optional.
elem : sequence of str
Non-objects subelements selected when the object is
being dropped.</UserDocu>
</Documentation>
</Methode>
<Methode Name="canDragAndDropObject">
<Documentation>
<UserDocu>canDragAndDropObject(obj) -> bool\n
<UserDocu>canDragAndDropObject(obj) -> bool
Check whether the child object can be removed from
other parent and added here by drag and drop.\n
obj : App.DocumentObject\n Object to be dragged and dropped.</UserDocu>
other parent and added here by drag and drop.
obj : App.DocumentObject
Object to be dragged and dropped.</UserDocu>
</Documentation>
</Methode>
<Methode Name="replaceObject">
<Documentation>
<UserDocu>replaceObject(oldObj, newObj) -> int\n
<UserDocu>replaceObject(oldObj, newObj) -> int
Replace a child object.
Returns 1 if succeeded, 0 if not found, -1 if not supported.\n
oldObj : App.DocumentObject\n Old object.
newObj : App.DocumentObject\n New object.</UserDocu>
Returns 1 if succeeded, 0 if not found, -1 if not supported.
oldObj : App.DocumentObject
Old object.
newObj : App.DocumentObject
New object.</UserDocu>
</Documentation>
</Methode>
<Methode Name="doubleClicked">
<Documentation>
<UserDocu>doubleClicked() -> bool\n
<UserDocu>doubleClicked() -> bool
Trigger double clicking the corresponding tree item of this view object.</UserDocu>
</Documentation>
</Methode>
<Methode Name="addDisplayMode">
<Documentation>
<UserDocu>addDisplayMode(obj, mode) -> None\n
Add a new display mode to the view provider.\n
obj : coin.SoNode\n Display mode.
mode : str\n Name of the display mode.</UserDocu>
<UserDocu>addDisplayMode(obj, mode) -> None
Add a new display mode to the view provider.
obj : coin.SoNode
Display mode.
mode : str
Name of the display mode.</UserDocu>
</Documentation>
</Methode>
<Methode Name="listDisplayModes">
<Documentation>
<UserDocu>listDisplayModes() -> list\n
<UserDocu>listDisplayModes() -> list
Show a list of all display modes.</UserDocu>
</Documentation>
</Methode>
<Methode Name="toString">
<Documentation>
<UserDocu>toString() -> str\n
<UserDocu>toString() -> str
Return a string representation of the Inventor node.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setTransformation">
<Documentation>
<UserDocu>setTransformation(trans) -> None\n
Set a transformation on the Inventor node.\n
<UserDocu>setTransformation(trans) -> None
Set a transformation on the Inventor node.
trans : Base.Placement, Base.Matrix</UserDocu>
</Documentation>
</Methode>
<Methode Name="claimChildren" Const="true">
<Documentation>
<UserDocu>claimChildren() -> list\n
<UserDocu>claimChildren() -> list
Returns list of objects that are to be grouped in tree under this object.</UserDocu>
</Documentation>
</Methode>
<Methode Name="partialRender">
<Documentation>
<UserDocu>partialRender(sub=None, clear=False) -> int\n
Render only part of the object.\n
sub: None, str, sequence of str\n Refer to the subelement. If it is None then reset the partial rendering.
clear: bool\n True to add, or False to remove the subelement(s) for rendering.</UserDocu>
<UserDocu>partialRender(sub=None, clear=False) -> int
Render only part of the object.
sub: None, str, sequence of str
Refer to the subelement. If it is None then reset the partial rendering.
clear: bool
True to add, or False to remove the subelement(s) for rendering.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getElementColors">
<Documentation>
<UserDocu>getElementColors(elementName) -> dict\n
<UserDocu>getElementColors(elementName) -> dict
Get a dictionary of the form {elementName : (r,g,b,a)}.
If no element name is given a dictionary with all the elements is returned.\n
elementName : str\n Name of the element. Optional.</UserDocu>
If no element name is given a dictionary with all the elements is returned.
elementName : str
Name of the element. Optional.</UserDocu>
</Documentation>
</Methode>
<Methode Name="setElementColors">
<Documentation>
<UserDocu>setElementColors(colors) -> None\n
Set element colors.\n
colors: dict\n Color dictionary of the form {elementName:(r,g,b,a)}.</UserDocu>
<UserDocu>setElementColors(colors) -> None
Set element colors.
colors: dict
Color dictionary of the form {elementName:(r,g,b,a)}.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getElementPicked" Const="true">
<Documentation>
<UserDocu>getElementPicked(pickPoint) -> str\n
Return the picked subelement.\n
<UserDocu>getElementPicked(pickPoint) -> str
Return the picked subelement.
pickPoint : coin.SoPickedPoint</UserDocu>
</Documentation>
</Methode>
<Methode Name="getDetailPath" Const="true">
<Documentation>
<UserDocu>getDetailPath(subelement, path, append=True) -> coin.SoDetail or None\n
Return Coin detail and path of an subelement.\n
subname: str\n Dot separated string reference to the sub element.
pPath: coin.SoPath\n Output coin path leading to the returned element detail.
append: bool\n If True, path will be first appended with the root node and the mode
<UserDocu>getDetailPath(subelement, path, append=True) -> coin.SoDetail or None
Return Coin detail and path of an subelement.
subname: str
Dot separated string reference to the sub element.
pPath: coin.SoPath
Output coin path leading to the returned element detail.
append: bool
If True, path will be first appended with the root node and the mode
switch node of this view provider.</UserDocu>
</Documentation>
</Methode>
<Methode Name="signalChangeIcon" Const="true">
<Documentation>
<UserDocu>signalChangeIcon() -> None\n
<UserDocu>signalChangeIcon() -> None
Trigger icon changed signal.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getBoundingBox">
<Documentation>
<UserDocu>getBoundingBox(subName, transform=True, view) -> Base.BoundBox\n
Obtain the bounding box of this view object.\n
subName : str\n Name referring a sub-object. Optional.
transform: bool\n Whether to apply the transformation matrix of this view provider.
view: View3DInventorPy\n Default to active view. Optional.</UserDocu>
<UserDocu>getBoundingBox(subName, transform=True, view) -> Base.BoundBox
Obtain the bounding box of this view object.
subName : str
Name referring a sub-object. Optional.
transform: bool
Whether to apply the transformation matrix of this view provider.
view: View3DInventorPy
Default to active view. Optional.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="Annotation" ReadOnly="false">

View File

@@ -168,7 +168,7 @@
<UserDocu>Add a group to mesh with specific name and type
addGroup(name, typestring, [id])
name: string
typestring: \"All\", \"Node\", \"Edge\", \"Face\", \"Volume\", \"0DElement\", \"Ball\"
typestring: "All", "Node", "Edge", "Face", "Volume", "0DElement", "Ball"
id: int
Optional id is used to force specific id for group, but does
not work, yet.

View File

@@ -14,7 +14,7 @@
<UserDocu>The Mesh::Feature class handles meshes.
The Mesh.MeshFeature() function is for internal use only and cannot be used to create instances of this class.
Therefore you must have a reference to a document, e.g. 'd' then you can create an instance with
d.addObject(\"Mesh::Feature\").
d.addObject("Mesh::Feature").
</UserDocu>
</Documentation>
<Methode Name="countPoints">

View File

@@ -23,7 +23,7 @@ Example:
m = Mesh.Mesh()
... # Manipulate the mesh
d = FreeCAD.activeDocument() # Get a reference to the actie document
f = d.addObject(\"Mesh::Feature\", \"Mesh\") # Create a mesh feature
f = d.addObject("Mesh::Feature", "Mesh") # Create a mesh feature
f.Mesh = m # Assign the mesh object to the internal property
d.recompute()</UserDocu>
</Documentation>

View File

@@ -136,13 +136,13 @@ of the nearest orthogonal projection of the point.</UserDocu>
<UserDocu>
Computes the projection of a point on the curve
projectPoint(Point=Vector,[Method=\"NearestPoint\"])
projectPoint(Vector,\"NearestPoint\") -> Vector
projectPoint(Vector,\"LowerDistance\") -> float
projectPoint(Vector,\"LowerDistanceParameter\") -> float
projectPoint(Vector,\"Distance\") -> list of floats
projectPoint(Vector,\"Parameter\") -> list of floats
projectPoint(Vector,\"Point\") -> list of points
projectPoint(Point=Vector,[Method="NearestPoint"])
projectPoint(Vector,"NearestPoint") -> Vector
projectPoint(Vector,"LowerDistance") -> float
projectPoint(Vector,"LowerDistanceParameter") -> float
projectPoint(Vector,"Distance") -> list of floats
projectPoint(Vector,"Parameter") -> list of floats
projectPoint(Vector,"Point") -> list of points
</UserDocu>
</Documentation>
</Methode>

View File

@@ -60,13 +60,13 @@ Computes the normal of parameter (u,v) on this geometry</UserDocu>
<UserDocu>
Computes the projection of a point on the surface
projectPoint(Point=Vector,[Method=\"NearestPoint\"])
projectPoint(Vector,\"NearestPoint\") -> Vector
projectPoint(Vector,\"LowerDistance\") -> float
projectPoint(Vector,\"LowerDistanceParameters\") -> tuple of floats (u,v)
projectPoint(Vector,\"Distance\") -> list of floats
projectPoint(Vector,\"Parameters\") -> list of tuples of floats
projectPoint(Vector,\"Point\") -> list of points
projectPoint(Point=Vector,[Method="NearestPoint"])
projectPoint(Vector,"NearestPoint") -> Vector
projectPoint(Vector,"LowerDistance") -> float
projectPoint(Vector,"LowerDistanceParameters") -> tuple of floats (u,v)
projectPoint(Vector,"Distance") -> list of floats
projectPoint(Vector,"Parameters") -> list of tuples of floats
projectPoint(Vector,"Point") -> list of points
</UserDocu>
</Documentation>
</Methode>

View File

@@ -13,8 +13,10 @@
Delete="true">
<Documentation>
<Author Licence="LGPL" Name="Zheng, Lei" EMail="realthunder.dev@gmail.com" />
<UserDocu>FreeCAD python wrapper of libarea\n
Path.Area(key=value ...)\n
<UserDocu>FreeCAD python wrapper of libarea
Path.Area(key=value ...)
The constructor accepts the same parameters as setParams(...) to configure the object
All arguments are optional.</UserDocu>
</Documentation>
@@ -25,7 +27,8 @@ All arguments are optional.</UserDocu>
</Methode>
<Methode Name="setPlane">
<Documentation>
<UserDocu>setPlane(shape): Set the working plane.\n
<UserDocu>setPlane(shape): Set the working plane.
The supplied shape does not need to be planar. Area will try to find planar
sub-shape (face, wire or edge). If more than one planar sub-shape is found, it
will prefer the top plane parallel to XY0 plane. If no working plane are set,
@@ -35,9 +38,13 @@ same algorithm</UserDocu>
</Methode>
<Methode Name="getShape" Keyword='true'>
<Documentation>
<UserDocu>getShape(index=-1,rebuild=False): Return the resulting shape\n
\n* index (-1): the index of the section. -1 means all sections. No effect on planar shape.\n
\n* rebuild: clean the internal cache and rebuild</UserDocu>
<UserDocu>getShape(index=-1,rebuild=False): Return the resulting shape
* index (-1): the index of the section. -1 means all sections. No effect on planar shape.
* rebuild: clean the internal cache and rebuild</UserDocu>
</Documentation>
</Methode>
<Methode Name="makeOffset" Keyword='true'>

View File

@@ -20,7 +20,8 @@
</Methode>
<Methode Name="setParams" Keyword="true">
<Documentation>
<UserDocu>setParams(key=value...): Convenient function to configure this feature.\n
<UserDocu>setParams(key=value...): Convenient function to configure this feature.
Same usage as Path.Area.setParams(). This function stores the parameters in the properties.</UserDocu>
</Documentation>
</Methode>

View File

@@ -13,35 +13,46 @@
Delete="true">
<Documentation>
<Author Licence="LGPL" Name="Shai Seger" EMail="shaise_at_g-mail" />
<UserDocu>FreeCAD python wrapper of PathSimulator\n
PathSimulator.PathSim():\n
Create a path simulator object\n</UserDocu>
<UserDocu>FreeCAD python wrapper of PathSimulator
PathSimulator.PathSim():
Create a path simulator object
</UserDocu>
</Documentation>
<Methode Name="BeginSimulation" Keyword='true'>
<Documentation>
<UserDocu>BeginSimulation(stock, resolution):\n
Start a simulation process on a box shape stock with given resolution\n</UserDocu>
<UserDocu>BeginSimulation(stock, resolution):
Start a simulation process on a box shape stock with given resolution
</UserDocu>
</Documentation>
</Methode>
<Methode Name="SetToolShape">
<Documentation>
<UserDocu>SetToolShape(shape):\n
Set the shape of the tool to be used for simulation\n</UserDocu>
<UserDocu>SetToolShape(shape):
Set the shape of the tool to be used for simulation
</UserDocu>
</Documentation>
</Methode>
<Methode Name="GetResultMesh">
<Documentation>
<UserDocu>
GetResultMesh():\n
Return the current mesh result of the simulation.\n
GetResultMesh():
Return the current mesh result of the simulation.
</UserDocu>
</Documentation>
</Methode>
<Methode Name="ApplyCommand" Keyword='true'>
<Documentation>
<UserDocu>
ApplyCommand(placement, command):\n
Apply a single path command on the stock starting from placement.\n
ApplyCommand(placement, command):
Apply a single path command on the stock starting from placement.
</UserDocu>
</Documentation>
</Methode>

View File

@@ -17,6 +17,13 @@ class TemplateClassPyExport(template.ModelTemplate):
path = self.path
exportName = self.export.Name
dirname = self.dirname
def escapeString(s, indent=4):
"""Escapes a string for use as literal in C++ code"""
s = s.strip() # This allows UserDocu-tags on their own lines without adding whitespace
s = s.replace('\\', '\\\\')
s = s.replace('"', '\\"')
s = s.replace('\n', f'\\n"\n{" "*indent}"')
return s
print("TemplateClassPyExport", path + exportName)
# Imp.cpp must not exist, neither in path nor in dirname
if not os.path.exists(path + exportName + "Imp.cpp"):
@@ -316,7 +323,7 @@ PyTypeObject @self.export.Name@::Type = {
nullptr, /* tp_as_buffer */
/* --- Flags to define presence of optional/expanded features */
Py_TPFLAGS_BASETYPE|Py_TPFLAGS_DEFAULT, /*tp_flags */
"@self.export.Documentation.UserDocu.replace('\\n','\\\\n\\"\\n \\"')@", /*tp_doc */
"@escapeString(self.export.Documentation.UserDocu, indent=4)@", /*tp_doc */
nullptr, /*tp_traverse */
nullptr, /*tp_clear */
+ if (self.export.RichCompare):
@@ -390,7 +397,7 @@ PyMethodDef @self.export.Name@::Methods[] = {
reinterpret_cast<PyCFunction>( staticCallback_@i.Name@ ),
METH_VARARGS,
-
"@i.Documentation.UserDocu.replace('\\n','\\\\n')@"
"@escapeString(i.Documentation.UserDocu, indent=8)@"
},
-
{nullptr, nullptr, 0, nullptr} /* Sentinel */
@@ -510,7 +517,7 @@ PyGetSetDef @self.export.Name@::GetterSetter[] = {
{"@i.Name@",
(getter) staticCallback_get@i.Name@,
(setter) staticCallback_set@i.Name@,
"@i.Documentation.UserDocu.replace('\\n','\\\\n')@",
"@escapeString(i.Documentation.UserDocu, indent=8)@",
nullptr
},
-