From: Nicolas RECHATIN Date: Mon, 2 Aug 2021 09:37:03 +0000 (+0200) Subject: doc Adding doc for Volume X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e149accc1a156b03700da7bd0444b36d53b9874b;p=modules%2Fshaper.git doc Adding doc for Volume --- diff --git a/src/OperaPlugin/OperaPlugin_Plugin.h b/src/OperaPlugin/OperaPlugin_Plugin.h index b4fd54ca7..a68e29f25 100644 --- a/src/OperaPlugin/OperaPlugin_Plugin.h +++ b/src/OperaPlugin/OperaPlugin_Plugin.h @@ -26,7 +26,7 @@ /**\class OperaPlugin_Plugin * \ingroup Plugins - * \brief The main class managing Primitive Features as plugins. + * \brief The main class managing Opera Features as plugins. */ class OPERAPLUGIN_EXPORT OperaPlugin_Plugin : public ModelAPI_Plugin { diff --git a/src/OperaPlugin/OperaPlugin_Volume.h b/src/OperaPlugin/OperaPlugin_Volume.h index a31e92176..75dcf614f 100644 --- a/src/OperaPlugin/OperaPlugin_Volume.h +++ b/src/OperaPlugin/OperaPlugin_Volume.h @@ -29,17 +29,15 @@ class ModelAPI_ResultBody; /**\class OperaPlugin_Volume * \ingroup Plugins - * \brief Feature for creation of a box primitive using various methods. + * \brief Feature for creation of a Volume using solids. * - * Box creates a cuboid - Parallelepiped with 6 rectangular faces. It can be built via three - * methods : using two points that define a diagonal, a point that define a center and 3 lengths - * that define the half-lengths on X, Y and Z-axes, or using 3 lengths that define the - * rectangular dimensions. + * Volume creates Volume object - This volume takes selected solids shape + * and transform the result to a volume with a medium for OPERA. */ class OperaPlugin_Volume : public ModelAPI_Feature { public: - /// Box kind + /// Volume kind inline static const std::string& ID() { static const std::string MY_VOLUME_ID("Volume"); @@ -72,11 +70,6 @@ class OperaPlugin_Volume : public ModelAPI_Feature /// Use plugin manager for features creation OperaPlugin_Volume(); - - private: - // - void loadNamingDS(std::shared_ptr theBoxAlgo, - std::shared_ptr theResultBox); }; #endif diff --git a/src/OperaPlugin/OperaPlugin_msg_fr.ts b/src/OperaPlugin/OperaPlugin_msg_fr.ts index 22d0de57f..fe1f1dd05 100644 --- a/src/OperaPlugin/OperaPlugin_msg_fr.ts +++ b/src/OperaPlugin/OperaPlugin_msg_fr.ts @@ -1,408 +1,3 @@ - - - - workshop - - Primitives - Primitives - - - Box - Boîte - - - Cone - Cône - - - Cylinder - Cylindre - - - Sphere - Sphère - - - Torus - Tore - - - - - Box - - Box - Boîte - - - Create a box - Créer une boîte - - - - Box:CreationMethod - - By dimensions - Par dimensions - - - By two points - Par deux points - - - - Box:FirstPoint - - First point - Premier point - - - Select a first point - Sélectionnez un premier point - - - - Box:FirstPoint - - Attribute "%1" is not initialized. - Sélectionnez un premier point. - - - - Box:SecondPoint - - Attribute "%1" is not initialized. - Sélectionnez un deuxième point. - - - - Box:SecondPoint - - Second point - Deuxième point - - - Select a second point - Sélectionnez un deuxième point - - - - Box:dx - - DX - DX - - - Dimension in X - Dimension en X - - - - Box:dy - - DY - DY - - - Dimension in Y - Dimension en Y - - - - Box:dz - - DZ - DZ - - - Dimension in Z - Dimension en Z - - - - - Cone - - Cone - Cône - - - Create a Cone - Créer un cône - - - - Cone:axis - - Select the axis of the cone - Sélectionnez l'axe du cône - - - Attribute "%1" is not initialized. - Sélectionnez l'axe du cône - - - axis - axe - - - - Cone:base_point - - Select the center of the base of the cone - Sélectionnez le centre de la base du cône - - - base_point - point de base - - - - Cone:base_radius - - Base radius - Rayon de la base - - - Enter the base radius of the cone - Entrez le rayon de base du cône - - - - Cone:height - - Enter the height of the cone - Entrez la hauteur du cône - - - height - hauteur - - - - Cone:top_radius - - Enter the top radius of the cone - Entrez le rayon supérieur du cône - - - Top radius - Rayon supérieur - - - - Cone:base_point - - Attribute "%1" is not initialized. - Sélectionnez le centre de la base du cône. - - - - Cone:base_point:GeomValidators_ConstructionComposite - - The result is empty - Le résultat est vide - - - - - Cylinder - - Create a cylinder - Créer un cylindre - - - Cylinder - Cylindre - - - - Cylinder:CreationMethod - - Cylinder - Cylindre - - - Portion of cylinder - Portion de cylindre - - - - Cylinder:angle - - Enter the angle of the portion of the cylinder - Entrez l'angle de la portion du cylindre - - - angle - angle - - - - Cylinder:axis - - Select the axis of the cylinder - Sélectionnez l'axe du cylindre. - - - Attribute "%1" is not initialized. - Sélectionnez l'axe du cylindre. - - - axis - axe - - - - Cylinder:base_point - - Select the center of the base of the cylinder - Sélectionnez le centre de la base du cylindre - - - base_point - point de base - - - - Cylinder:height - - Enter the height of the cylinder - Entrez la hauteur du cylindre - - - height - hauteur - - - - Cylinder:radius - - Enter the radius of the cylinder - Entrez le rayon du cylindre - - - radius - rayon - - - - Cylinder:base_point - - Attribute "%1" is not initialized. - Sélectionnez le centre de la base du cylindre. - - - - Cylinder:base_point:GeomValidators_ConstructionComposite - - The result is empty - Le résultat est vide - - - - - Sphere - - Create a sphere - Créer une sphère - - - Sphere - Sphère - - - - Sphere:center_point - - Center point - Point central - - - Select a center point - Sélectionnez un point central. - - - Attribute "%1" is not initialized. - Sélectionnez un point central. - - - - Sphere:radius - - Enter a radius - Entrez un rayon - - - Radius - Rayon - - - - - Torus - - Create a Torus - Créer un tore - - - Torus - Tore - - - - Torus:axis - - Select the axis of the torus - Sélectionnez l'axe du tore. - - - Attribute "%1" is not initialized. - Sélectionnez l'axe du tore. - - - axis - axe - - - - Torus:base_point - - Select the center of the torus - Sélectionnez le centre du tore. - - - Attribute "%1" is not initialized. - Sélectionnez le centre du tore. - - - base_point - point de base - - - - Torus:radius - - Enter the radius of the torus - Entrez le rayon du tore - - - Radius - Rayon - - - - Torus:ring_radius - - Enter the ring radius of the torus - Entrez le rayon de l'anneau du tore - - - Ring radius - Rayon de l'anneau - - - - + diff --git a/src/OperaPlugin/doc/OperaPlugin.rst b/src/OperaPlugin/doc/OperaPlugin.rst new file mode 100644 index 000000000..41da0e59a --- /dev/null +++ b/src/OperaPlugin/doc/OperaPlugin.rst @@ -0,0 +1,13 @@ + +.. _operaPlugin: + +Opera plug-in +================== + +The Opera plug-in contains features for creation of Opera items. Result of each feature is a solid. The plug-in includes the following features: + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + volumeFeature.rst diff --git a/src/OperaPlugin/doc/addvolumeFeature.rst b/src/OperaPlugin/doc/addvolumeFeature.rst deleted file mode 100644 index e91466c20..000000000 --- a/src/OperaPlugin/doc/addvolumeFeature.rst +++ /dev/null @@ -1,136 +0,0 @@ -.. |Box_button.icon| image:: images/Box_button.png - -Box -=== - -Box feature creates a box solid. - -To create a Box in the active part: - -#. select in the Main Menu *Primitives - > Box* item or -#. click |Box_button.icon| **Box** button in the toolbar: - -There are 3 algorithms for creation of a Box: - -.. figure:: images/box_dxyz_32x32.png - :align: left - :height: 24px - -**By dimensions** - -.. figure:: images/box_2pt_32x32.png - :align: left - :height: 24px - -**By two points** - -.. figure:: images/box_pt_dxyz_32x32.png - :align: left - :height: 24px - -**By coordinates of a point and dimensions** - --------------------------------------------------------------------------------- - -By dimensions -------------- - -Box is created by dimensions along X, Y, Z axis starting from the origin. - -.. figure:: images/Box_dimensions.png - :align: center - -Input fields: - -- **DX**, **DY**, **DZ** define dimensions of the box along the corresponding coordinate axes. - -**TUI Command**: - -.. py:function:: model.addBox(Part_doc, DX, DY, DZ) - - :param part: The current part object. - :param real: Size along X. - :param real: Size along Y. - :param real: Size along Z. - :return: Result object. - -Result -"""""" - -A solid box based on the origin of coordinates and with edges parallel to the coordinate axes. - -.. figure:: images/Box1.png - :align: center - -**See Also** a sample TUI Script of a :ref:`tui_create_boxdim` operation. - -By two points -------------- - -Box is created by two points of the box diagonal. - -.. figure:: images/Box_2points.png - :align: center - -Input fields: - -- **Point 1** and **Point 2** define diagonal points of the box selected in 3D OCC viewer or object browser. - -**TUI Command**: - -.. py:function:: model.addBox(Part_doc, point1, point2) - - :param part: The current part object. - :param object: First vertex of diagonal. - :param object: Second vertex of diagonal. - :return: Result object. - -Result -"""""" - -A solid box based on two points and with edges parallel to the coordinate axes. - -.. figure:: images/Box2.png - :align: center - - Created boxes - -**See Also** a sample TUI Script of :ref:`tui_create_boxpnt` operation. - -By coordinates of a point and dimensions ----------------------------------------- - -Box is created by dimensions along X, Y, Z axis starting from the point of coordinates (x,y,z). - -.. figure:: images/Box_ptAndDims.png - :align: center - -Input fields: - -- **OX**, **OY**, **OZ** define coordinates of the center of box. -- **DX**, **DY**, **DZ** define dimensions (hafl length) of the box along the corresponding coordinate axes. - -**TUI Command**: - -.. py:function:: model.addBox(Part_doc, OX, OY, OZ, DX, DY, DZ) - - :param part: The current part object. - :param real: X coordinate of the center point - :param real: Y coordinate of the center point - :param real: Z coordinate of the center point - :param real: Half size along X. - :param real: Half size along Y. - :param real: Half size along Z. - :return: Result object. - -Result -"""""" - -A solid box whose point coordinates are the center and the dimensions are half lengths on one side and the other on the axes relative to the center. - -.. figure:: images/Box3.png - :align: center - - Created boxes - -**See Also** a sample TUI Script of :ref:`tui_create_boxptdim` operation. diff --git a/src/OperaPlugin/doc/example/volume.py b/src/OperaPlugin/doc/example/volume.py new file mode 100644 index 000000000..a21ef5396 --- /dev/null +++ b/src/OperaPlugin/doc/example/volume.py @@ -0,0 +1,12 @@ +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() + +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +Volume_1 = model.addVolume(Part_1_doc, "Air", [model.selection("SOLID", "Box_1_1")]) + +model.do() +model.end() diff --git a/src/OperaPlugin/doc/images/Volume1.png b/src/OperaPlugin/doc/images/Volume1.png new file mode 100644 index 000000000..4e8a1d2a8 Binary files /dev/null and b/src/OperaPlugin/doc/images/Volume1.png differ diff --git a/src/OperaPlugin/doc/images/Volume_button.png b/src/OperaPlugin/doc/images/Volume_button.png new file mode 100644 index 000000000..aaa604aad Binary files /dev/null and b/src/OperaPlugin/doc/images/Volume_button.png differ diff --git a/src/OperaPlugin/doc/images/Volume_create.png b/src/OperaPlugin/doc/images/Volume_create.png new file mode 100644 index 000000000..a4e64a2dc Binary files /dev/null and b/src/OperaPlugin/doc/images/Volume_create.png differ diff --git a/src/OperaPlugin/doc/volumeFeature.rst b/src/OperaPlugin/doc/volumeFeature.rst new file mode 100644 index 000000000..f3541686e --- /dev/null +++ b/src/OperaPlugin/doc/volumeFeature.rst @@ -0,0 +1,39 @@ +.. |Volume_button.icon| image:: images/Volume_button.png + +Volume feature creates a box solid. + +To create a Volume in the active part: + +#. select in the Main Menu *Opera - > Volume* item or +#. click |Volume_button.icon| **Volume** button in the toolbar: + +-------------------------------------------------------------------------------- + +by Medium and Solids +------------- + +Volume is created by a Medium value and a list of solids + +.. figure:: images/Volume_create.png + :align: center + +Input fields: + +- **MEDIUM**, **VOLUME_LIST** define medium and shapes of the volume. + +**TUI Command**: + +.. py:function:: model.addVolume(Part_doc, MEDIUM, VOLUME_LIST) + + :param part: The current part object. + :param real: Medium name. + :param real: List of solids. + :return: Result object. + +Result +"""""" + +One solid for each selected solid in the volume list with according medium + +.. figure:: images/Volume1.png + :align: center