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

@@ -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>