From 1ea8e041ffcc8d125d499265fc5b39e485001930 Mon Sep 17 00:00:00 2001 From: spo Date: Fri, 4 Dec 2015 17:46:32 +0300 Subject: [PATCH] Add Sphinx documentation --- src/PythonAPI/doc/source/boolean.rst | 15 ++++ src/PythonAPI/doc/source/connection.rst | 9 ++ src/PythonAPI/doc/source/construction.rst | 37 ++++++++ src/PythonAPI/doc/source/exchange.rst | 26 ++++++ src/PythonAPI/doc/source/extrusion.rst | 33 +++++-- src/PythonAPI/doc/source/group.rst | 13 +++ src/PythonAPI/doc/source/index.rst | 19 +++- src/PythonAPI/doc/source/model.rst | 101 ++++++++++++++++++++++ src/PythonAPI/doc/source/parameter.rst | 13 +++ src/PythonAPI/doc/source/partition.rst | 13 +++ src/PythonAPI/doc/source/partset.rst | 17 ++++ src/PythonAPI/doc/source/placement.rst | 13 +++ src/PythonAPI/doc/source/revolution.rst | 36 ++++++++ src/PythonAPI/doc/source/rotation.rst | 13 +++ src/PythonAPI/doc/source/swig.rst | 11 +++ src/PythonAPI/doc/source/translation.rst | 13 +++ src/PythonAPI/model/features/partition.py | 2 +- 17 files changed, 375 insertions(+), 9 deletions(-) create mode 100644 src/PythonAPI/doc/source/boolean.rst create mode 100644 src/PythonAPI/doc/source/connection.rst create mode 100644 src/PythonAPI/doc/source/construction.rst create mode 100644 src/PythonAPI/doc/source/exchange.rst create mode 100644 src/PythonAPI/doc/source/group.rst create mode 100644 src/PythonAPI/doc/source/model.rst create mode 100644 src/PythonAPI/doc/source/parameter.rst create mode 100644 src/PythonAPI/doc/source/partition.rst create mode 100644 src/PythonAPI/doc/source/partset.rst create mode 100644 src/PythonAPI/doc/source/placement.rst create mode 100644 src/PythonAPI/doc/source/revolution.rst create mode 100644 src/PythonAPI/doc/source/rotation.rst create mode 100644 src/PythonAPI/doc/source/swig.rst create mode 100644 src/PythonAPI/doc/source/translation.rst diff --git a/src/PythonAPI/doc/source/boolean.rst b/src/PythonAPI/doc/source/boolean.rst new file mode 100644 index 000000000..abe39727b --- /dev/null +++ b/src/PythonAPI/doc/source/boolean.rst @@ -0,0 +1,15 @@ +Boolean +======= + +Create Boolean +-------------- + +.. autofunction:: model.addAddition +.. autofunction:: model.addSubtraction +.. autofunction:: model.addIntersection + +Boolean object +-------------- + +.. autoclass:: model.features.boolean.Boolean + :members: diff --git a/src/PythonAPI/doc/source/connection.rst b/src/PythonAPI/doc/source/connection.rst new file mode 100644 index 000000000..5a175fec3 --- /dev/null +++ b/src/PythonAPI/doc/source/connection.rst @@ -0,0 +1,9 @@ +Connection +---------- + +This feature is only for SALOME. + +Exprot to GEOM +.............. + +.. autofunction:: model.exportToGEOM diff --git a/src/PythonAPI/doc/source/construction.rst b/src/PythonAPI/doc/source/construction.rst new file mode 100644 index 000000000..8f13053f5 --- /dev/null +++ b/src/PythonAPI/doc/source/construction.rst @@ -0,0 +1,37 @@ +Construction +============ + +Create construction features. + +Create a point +-------------- + +.. autofunction:: model.addPoint + +Point object +............ + +.. autoclass:: model.construction.point.Point + :members: + +Create an axis +-------------- + +.. autofunction:: model.addAxis + +Axis object +........... + +.. autoclass:: model.construction.axis.Axis + :members: + +Create a plane +-------------- + +.. autofunction:: model.addPlane + +Plane object +............ + +.. autoclass:: model.construction.plane.Plane + :members: diff --git a/src/PythonAPI/doc/source/exchange.rst b/src/PythonAPI/doc/source/exchange.rst new file mode 100644 index 000000000..737cb7737 --- /dev/null +++ b/src/PythonAPI/doc/source/exchange.rst @@ -0,0 +1,26 @@ +Exchange +======== + +Export/import features. + +Import objects from a file +-------------------------- + +.. autofunction:: model.addImport + +Import object +............. + +.. autoclass:: model.exchange.exchange.Import + :members: + +Export objects to a file +------------------------ + +.. autofunction:: model.exportToFile + +Export object +............. + +.. autoclass:: model.exchange.exchange.Export + :members: diff --git a/src/PythonAPI/doc/source/extrusion.rst b/src/PythonAPI/doc/source/extrusion.rst index 25d77281c..2f81a25c6 100644 --- a/src/PythonAPI/doc/source/extrusion.rst +++ b/src/PythonAPI/doc/source/extrusion.rst @@ -1,5 +1,5 @@ Extrusion ---------- +========= .. testsetup:: @@ -25,16 +25,39 @@ by the following code: >>> # Modification of the extrusion >>> extrusion.setSize(20) -All the ways to create an extrusion and the data access and modification methods +All the ways to create an extrusion and the data access and modification methods of the extrusion are documented below Create an extrusion -................... - -.. autofunction:: model.features.extrusion.addExtrusion +------------------- + +.. autofunction:: model.addExtrusion Extrusion object ................ .. autoclass:: model.features.extrusion.Extrusion :members: + +Create an Extrusion Bolean +-------------------------- + +.. autofunction:: model.addExtrusionCut +.. autofunction:: model.addExtrusionFuse + +Extrusion Boolean object +........................ + +.. autoclass:: model.features.extrusion_boolean.ExtrusionBoolean + :members: + +Create an Extrusion Sketch +-------------------------- + +.. autofunction:: model.addExtrusionSketch + +Extrusion Sketch object +....................... + +.. autoclass:: model.features.extrusion_sketch.ExtrusionSketch + :members: diff --git a/src/PythonAPI/doc/source/group.rst b/src/PythonAPI/doc/source/group.rst new file mode 100644 index 000000000..b6765a189 --- /dev/null +++ b/src/PythonAPI/doc/source/group.rst @@ -0,0 +1,13 @@ +Group +===== + +Create a group +-------------- + +.. autofunction:: model.addGroup + +Group object +............ + +.. autoclass:: model.features.group.Group + :members: diff --git a/src/PythonAPI/doc/source/index.rst b/src/PythonAPI/doc/source/index.rst index ef5dc2733..91677e73d 100644 --- a/src/PythonAPI/doc/source/index.rst +++ b/src/PythonAPI/doc/source/index.rst @@ -9,7 +9,7 @@ models through python scripts: * a "parametric" API, which is very close to what is done in the graphical interface and allows you to recalculate a model - when a parameter is changed + when a parameter is changed Parametric API -------------- @@ -31,16 +31,29 @@ Features ........ This API provides functions for creating the features listed below. -These functions return an interface to the feature that allow +These functions return an interface to the feature that allow to modify the feature and retrieve data from it. .. toctree:: :maxdepth: 1 sketcher - extrusion + connection + construction + exchange + boolean + partition + extrusion + revolution + placement + rotation + translation + group + + parameter + partset Indices and tables ================== diff --git a/src/PythonAPI/doc/source/model.rst b/src/PythonAPI/doc/source/model.rst new file mode 100644 index 000000000..865de2ab2 --- /dev/null +++ b/src/PythonAPI/doc/source/model.rst @@ -0,0 +1,101 @@ +.. py:module:: model + +Parametric Geometry API +*********************** + +.. automodule:: model + :members: + :special-members: + +Common Modules +============== + +This modules are used by other submodules of Parametric Geometry API. + +roots +----- + +.. automodule:: model.roots + :members: + :special-members: + +services +-------- + +.. automodule:: model.services + :members: + :special-members: + +tools +----- + +.. automodule:: model.tools + :members: + :special-members: + +errors +------ + +.. automodule:: model.errors + :members: + :special-members: + +Modules fo Plugins +================== + +connection +---------- + +.. automodule:: model.connection + :members: + :special-members: + +.. autofunction:: model.connection.connection.exportToGEOM + +construction +------------ + +.. automodule:: model.construction + :members: + :special-members: + +exchange +-------- + +.. automodule:: model.exchange + :members: + :special-members: + +features +-------- + +.. automodule:: model.features + :members: + :special-members: + +parameter +......... + +.. automodule:: model.parameter + :members: + :special-members: + +partset +------- + +.. automodule:: model.partset + :members: + :special-members: + +sketcher +-------- + +.. automodule:: model.sketcher + :members: + :special-members: + +.. toctree:: + :maxdepth: 1 + + sketcher + diff --git a/src/PythonAPI/doc/source/parameter.rst b/src/PythonAPI/doc/source/parameter.rst new file mode 100644 index 000000000..6b62c9f9b --- /dev/null +++ b/src/PythonAPI/doc/source/parameter.rst @@ -0,0 +1,13 @@ +Parameter +========= + +Create a parameter +------------------ + +.. autofunction:: model.addParameter + +Parameter object +................ + +.. autoclass:: model.parameter.parameter.Parameter + :members: diff --git a/src/PythonAPI/doc/source/partition.rst b/src/PythonAPI/doc/source/partition.rst new file mode 100644 index 000000000..75c3b7f0b --- /dev/null +++ b/src/PythonAPI/doc/source/partition.rst @@ -0,0 +1,13 @@ +Partition +========= + +Create a partition +------------------ + +.. autofunction:: model.addPartition + +Partition object +................ + +.. autoclass:: model.features.partition.Partition + :members: diff --git a/src/PythonAPI/doc/source/partset.rst b/src/PythonAPI/doc/source/partset.rst new file mode 100644 index 000000000..5427d7f63 --- /dev/null +++ b/src/PythonAPI/doc/source/partset.rst @@ -0,0 +1,17 @@ +PartSet +======= + +Manipulate Parts in a PartSet. + +Manipulate a Part +----------------- + +.. autofunction:: model.addPart +.. autofunction:: model.duplicatePart +.. autofunction:: model.removePart + +Part object +........... + +.. autoclass:: model.partset.part.Part + :members: diff --git a/src/PythonAPI/doc/source/placement.rst b/src/PythonAPI/doc/source/placement.rst new file mode 100644 index 000000000..3834ce7a1 --- /dev/null +++ b/src/PythonAPI/doc/source/placement.rst @@ -0,0 +1,13 @@ +Placement +========= + +Create a placement +------------------ + +.. autofunction:: model.addPlacement + +Placement object +................ + +.. autoclass:: model.features.placement.Placement + :members: diff --git a/src/PythonAPI/doc/source/revolution.rst b/src/PythonAPI/doc/source/revolution.rst new file mode 100644 index 000000000..061904ff9 --- /dev/null +++ b/src/PythonAPI/doc/source/revolution.rst @@ -0,0 +1,36 @@ +Revolution +========== + +Create a Revolution +------------------- + +.. autofunction:: model.addRevolution + +Revolution object +................. + +.. autoclass:: model.features.revolution.Revolution + :members: + +Create an Revolution Bolean +--------------------------- + +.. autofunction:: model.addRevolutionCut +.. autofunction:: model.addRevolutionFuse + +Revolution Boolean object +......................... + +.. autoclass:: model.features.revolution_boolean.RevolutionBoolean + :members: + +Create an Revolution Sketch +--------------------------- + +.. autofunction:: model.addRevolutionSketch + +Revolution Sketch object +........................ + +.. autoclass:: model.features.revolution_sketch.RevolutionSketch + :members: diff --git a/src/PythonAPI/doc/source/rotation.rst b/src/PythonAPI/doc/source/rotation.rst new file mode 100644 index 000000000..70619bb81 --- /dev/null +++ b/src/PythonAPI/doc/source/rotation.rst @@ -0,0 +1,13 @@ +Rotation +======== + +Create a rotation +----------------- + +.. autofunction:: model.addRotation + +Rotation object +............... + +.. autoclass:: model.features.rotation.Rotation + :members: diff --git a/src/PythonAPI/doc/source/swig.rst b/src/PythonAPI/doc/source/swig.rst new file mode 100644 index 000000000..e4129316e --- /dev/null +++ b/src/PythonAPI/doc/source/swig.rst @@ -0,0 +1,11 @@ +SWIG Generated Modules +====================== + +ModelAPI +-------- + +.. inheritance-diagram:: ModelAPI +.. automodule:: ModelAPI + :members: + :special-members: + diff --git a/src/PythonAPI/doc/source/translation.rst b/src/PythonAPI/doc/source/translation.rst new file mode 100644 index 000000000..6f3f4a9cc --- /dev/null +++ b/src/PythonAPI/doc/source/translation.rst @@ -0,0 +1,13 @@ +Translation +=========== + +Create a translation +-------------------- + +.. autofunction:: model.addTranslation + +Translation object +.................. + +.. autoclass:: model.features.translation.Translation + :members: diff --git a/src/PythonAPI/model/features/partition.py b/src/PythonAPI/model/features/partition.py index fb9056e7c..e6e695122 100644 --- a/src/PythonAPI/model/features/partition.py +++ b/src/PythonAPI/model/features/partition.py @@ -7,7 +7,7 @@ from model.roots import Interface def addPartition(part, *args): - """Add an Partition feature to the Part and return Partition. + """Add a Partition feature to the Part and return Partition. Pass all args to Partition __init__ function. """ -- 2.39.2