ADD_SUBDIRECTORY (src/ConstructionPlugin)
ADD_SUBDIRECTORY (src/BuildPlugin)
ADD_SUBDIRECTORY (src/PrimitivesPlugin)
+
+ADD_SUBDIRECTORY (src/OperaPlugin)
+
ADD_SUBDIRECTORY (src/GDMLPlugin)
ADD_SUBDIRECTORY (src/FeaturesPlugin)
ADD_SUBDIRECTORY (src/CollectionPlugin)
<plugin library="ConstructionPlugin" configuration="plugin-Construction.xml"/>
<plugin library="BuildPlugin" configuration="plugin-Build.xml"/>
<plugin library="PrimitivesPlugin" configuration="plugin-Primitives.xml"/>
+ <plugin library="OperaPlugin" configuration="plugin-Opera.xml"/>
<!--<plugin library="GDMLPlugin" configuration="plugin-GDML.xml"/>-->
<plugin library="FeaturesPlugin" configuration="plugin-Features.xml"/>
<plugin library="CollectionPlugin" configuration="plugin-Collection.xml"/>
--- /dev/null
+# Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(PROJECT_HEADERS
+ OperaPlugin.h
+ OperaPlugin_Plugin.h
+ OperaPlugin_Volume.h
+)
+
+SET(PROJECT_SOURCES
+ OperaPlugin_Plugin.cpp
+ OperaPlugin_Volume.cpp
+
+)
+
+SET(XML_RESOURCES
+ plugin-Opera.xml
+ addvolume_widget.xml
+)
+
+SET(TEXT_RESOURCES
+ OperaPlugin_msg_fr.ts
+)
+
+SOURCE_GROUP ("XML Files" FILES ${XML_RESOURCES})
+SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES})
+
+INCLUDE_DIRECTORIES(
+ ../ModelAPI
+ ../GeomAPI
+ ../GeomAlgoAPI
+ ../Events
+)
+
+SET(PROJECT_LIBRARIES
+ Events
+ ModelAPI
+ GeomAPI
+ GeomAlgoAPI
+)
+
+ADD_DEFINITIONS(-DOPERAPLUGIN_EXPORTS)
+ADD_LIBRARY(OperaPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES})
+TARGET_LINK_LIBRARIES(OperaPlugin ${PROJECT_LIBRARIES})
+
+INSTALL(TARGETS OperaPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
+INSTALL(FILES ${XML_RESOURCES} ${TEXT_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES})
+INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}/icons/Opera)
+
+
--- /dev/null
+// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef OPERAPLUGIN_H
+#define OPERAPLUGIN_H
+
+#if defined OPERAPLUGIN_EXPORTS
+#if defined WIN32
+#define OPERAPLUGIN_EXPORT __declspec( dllexport )
+#else
+#define OPERAPLUGIN_EXPORT
+#endif
+#else
+#if defined WIN32
+#define OPERAPLUGIN_EXPORT __declspec( dllimport )
+#else
+#define OPERAPLUGIN_EXPORT
+#endif
+#endif
+
+#endif
--- /dev/null
+// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <OperaPlugin_Plugin.h>
+#include <OperaPlugin_Volume.h>
+
+#include <ModelAPI_Session.h>
+
+#include <string>
+#include <memory>
+#include <iostream>
+
+// the only created instance of this plugin
+static OperaPlugin_Plugin* MY_PRIMITIVES_INSTANCE = new OperaPlugin_Plugin();
+
+OperaPlugin_Plugin::OperaPlugin_Plugin()
+{
+ // register this plugin
+ ModelAPI_Session::get()->registerPlugin(this);
+}
+
+FeaturePtr OperaPlugin_Plugin::createFeature(std::string theFeatureID)
+{
+ if (theFeatureID == OperaPlugin_Volume::ID()) {
+ return FeaturePtr(new OperaPlugin_Volume);
+ } else {
+ // else if (theFeatureID == OperaPlugin_addNode::ID()){
+ // return FeaturePtr(new OperaPlugin_addNode);
+ return FeaturePtr();
+ }
+}
--- /dev/null
+// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef OperaPlugin_Plugin_H_
+#define OperaPlugin_Plugin_H_
+
+#include "OperaPlugin.h"
+#include <ModelAPI_Plugin.h>
+#include <ModelAPI_Feature.h>
+
+/**\class OperaPlugin_Plugin
+ * \ingroup Plugins
+ * \brief The main class managing Primitive Features as plugins.
+ */
+class OPERAPLUGIN_EXPORT OperaPlugin_Plugin : public ModelAPI_Plugin
+{
+ public:
+ /// Creates the feature object of this plugin by the feature string ID
+ virtual FeaturePtr createFeature(std::string theFeatureID);
+
+ public:
+ /// Default constructor
+ OperaPlugin_Plugin();
+
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <OperaPlugin_Volume.h>
+
+#include <ModelAPI_Data.h>
+#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_AttributeString.h>
+
+#include <GeomAlgoAPI_PointBuilder.h>
+
+
+#include <ModelAPI_ResultPart.h>
+#include <GeomAPI_ShapeHierarchy.h>
+
+
+#include <memory>
+#include <iostream>
+
+//=================================================================================================
+OperaPlugin_Volume::OperaPlugin_Volume() // Nothing to do during instantiation
+{
+}
+
+//=================================================================================================
+void OperaPlugin_Volume::initAttributes()
+{
+ data()->addAttribute(OperaPlugin_Volume::MEDIUM(), ModelAPI_AttributeString::typeId());
+
+ // AttributeSelectionListPtr aList =
+ // std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(data()->addAttribute(
+ // OperaPlugin_Volume::LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
+
+ AttributeSelectionListPtr aList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(
+ data()->addAttribute(OperaPlugin_Volume::LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
+ aList->setWholeResultAllowed(true); // allow to select the whole result
+
+}
+
+#include <GeomAlgoAPI_MakeShapeList.h>
+//=================================================================================================
+void OperaPlugin_Volume::execute()
+{
+ // Getting objects.
+ std::cout << "Before" << std::endl;
+
+ std::cout << "EXECUTE" << std::endl;
+
+ std::cout << "After" << std::endl;
+}
+
+//=================================================================================================
+void OperaPlugin_Volume::loadNamingDS(std::shared_ptr<GeomAlgoAPI_Box> theBoxAlgo,
+ std::shared_ptr<ModelAPI_ResultBody> theResultBox)
+{
+ // Load the result
+ theResultBox->store(theBoxAlgo->shape());
+
+ // Prepare the naming
+ theBoxAlgo->prepareNamingFaces();
+
+ // Insert to faces
+ std::map< std::string, std::shared_ptr<GeomAPI_Shape> > listOfFaces =
+ theBoxAlgo->getCreatedFaces();
+ for (std::map< std::string, std::shared_ptr<GeomAPI_Shape> >::iterator it = listOfFaces.begin();
+ it != listOfFaces.end();
+ ++it)
+ {
+ theResultBox->generated((*it).second, (*it).first);
+ }
+}
--- /dev/null
+// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef OperaPlugin_Volume_H_
+#define OperaPlugin_Volume_H_
+
+#include <OperaPlugin.h>
+#include <ModelAPI_Feature.h>
+#include <GeomAlgoAPI_Box.h>
+
+class GeomAPI_Shape;
+class ModelAPI_ResultBody;
+
+/**\class OperaPlugin_Volume
+ * \ingroup Plugins
+ * \brief Feature for creation of a box primitive using various methods.
+ *
+ * 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.
+ */
+class OperaPlugin_Volume : public ModelAPI_Feature
+{
+ public:
+ /// Box kind
+ inline static const std::string& ID()
+ {
+ static const std::string MY_VOLUME_ID("addVolume");
+ return MY_VOLUME_ID;
+ }
+ inline static const std::string& MEDIUM()
+ {
+ static const std::string MY_MEDIUM_ID("medium");
+ return MY_MEDIUM_ID;
+ }
+ /// attribute name of selected entities list
+ inline static const std::string& LIST_ID()
+ {
+ static const std::string MY_VOLUME_LIST_ID("volume_list");
+ return MY_VOLUME_LIST_ID;
+ }
+
+ // Creates a new part document if needed
+ OPERAPLUGIN_EXPORT virtual void execute();
+
+ /// Request for initialization of data model of the feature: adding all attributes
+ OPERAPLUGIN_EXPORT virtual void initAttributes();
+
+ /// Returns the kind of a feature
+ OPERAPLUGIN_EXPORT virtual const std::string& getKind()
+ {
+ static std::string MY_KIND = OperaPlugin_Volume::ID();
+ return MY_KIND;
+ }
+
+ /// Use plugin manager for features creation
+ OperaPlugin_Volume();
+
+ private:
+ //
+ void loadNamingDS(std::shared_ptr<GeomAlgoAPI_Box> theBoxAlgo,
+ std::shared_ptr<ModelAPI_ResultBody> theResultBox);
+};
+
+#endif
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+
+ <context>
+ <name>workshop</name>
+ <message>
+ <source>Primitives</source>
+ <translation>Primitives</translation>
+ </message>
+ <message>
+ <source>Box</source>
+ <translation>Boîte</translation>
+ </message>
+ <message>
+ <source>Cone</source>
+ <translation>Cône</translation>
+ </message>
+ <message>
+ <source>Cylinder</source>
+ <translation>Cylindre</translation>
+ </message>
+ <message>
+ <source>Sphere</source>
+ <translation>Sphère</translation>
+ </message>
+ <message>
+ <source>Torus</source>
+ <translation>Tore</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>Box</name>
+ <message>
+ <source>Box</source>
+ <translation>Boîte</translation>
+ </message>
+ <message>
+ <source>Create a box</source>
+ <translation>Créer une boîte</translation>
+ </message>
+ </context>
+ <context>
+ <name>Box:CreationMethod</name>
+ <message>
+ <source>By dimensions</source>
+ <translation>Par dimensions</translation>
+ </message>
+ <message>
+ <source>By two points</source>
+ <translation>Par deux points</translation>
+ </message>
+ </context>
+ <context>
+ <name>Box:FirstPoint</name>
+ <message>
+ <source>First point</source>
+ <translation>Premier point</translation>
+ </message>
+ <message>
+ <source>Select a first point</source>
+ <translation>Sélectionnez un premier point</translation>
+ </message>
+ </context>
+ <context>
+ <name>Box:FirstPoint</name>
+ <message>
+ <source>Attribute "%1" is not initialized.</source>
+ <translation>Sélectionnez un premier point.</translation>
+ </message>
+ </context>
+ <context>
+ <name>Box:SecondPoint</name>
+ <message>
+ <source>Attribute "%1" is not initialized.</source>
+ <translation>Sélectionnez un deuxième point.</translation>
+ </message>
+ </context>
+ <context>
+ <name>Box:SecondPoint</name>
+ <message>
+ <source>Second point</source>
+ <translation>Deuxième point</translation>
+ </message>
+ <message>
+ <source>Select a second point</source>
+ <translation>Sélectionnez un deuxième point</translation>
+ </message>
+ </context>
+ <context>
+ <name>Box:dx</name>
+ <message>
+ <source>DX</source>
+ <translation>DX</translation>
+ </message>
+ <message>
+ <source>Dimension in X</source>
+ <translation>Dimension en X</translation>
+ </message>
+ </context>
+ <context>
+ <name>Box:dy</name>
+ <message>
+ <source>DY</source>
+ <translation>DY</translation>
+ </message>
+ <message>
+ <source>Dimension in Y</source>
+ <translation>Dimension en Y</translation>
+ </message>
+ </context>
+ <context>
+ <name>Box:dz</name>
+ <message>
+ <source>DZ</source>
+ <translation>DZ</translation>
+ </message>
+ <message>
+ <source>Dimension in Z</source>
+ <translation>Dimension en Z</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>Cone</name>
+ <message>
+ <source>Cone</source>
+ <translation>Cône</translation>
+ </message>
+ <message>
+ <source>Create a Cone</source>
+ <translation>Créer un cône</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cone:axis</name>
+ <message>
+ <source>Select the axis of the cone</source>
+ <translation>Sélectionnez l'axe du cône</translation>
+ </message>
+ <message>
+ <source>Attribute "%1" is not initialized.</source>
+ <translation>Sélectionnez l'axe du cône</translation>
+ </message>
+ <message>
+ <source>axis</source>
+ <translation>axe</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cone:base_point</name>
+ <message>
+ <source>Select the center of the base of the cone</source>
+ <translation>Sélectionnez le centre de la base du cône</translation>
+ </message>
+ <message>
+ <source>base_point</source>
+ <translation>point de base</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cone:base_radius</name>
+ <message>
+ <source>Base radius</source>
+ <translation>Rayon de la base</translation>
+ </message>
+ <message>
+ <source>Enter the base radius of the cone</source>
+ <translation>Entrez le rayon de base du cône</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cone:height</name>
+ <message>
+ <source>Enter the height of the cone</source>
+ <translation>Entrez la hauteur du cône</translation>
+ </message>
+ <message>
+ <source>height</source>
+ <translation>hauteur</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cone:top_radius</name>
+ <message>
+ <source>Enter the top radius of the cone</source>
+ <translation>Entrez le rayon supérieur du cône</translation>
+ </message>
+ <message>
+ <source>Top radius</source>
+ <translation>Rayon supérieur</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cone:base_point</name>
+ <message>
+ <source>Attribute "%1" is not initialized.</source>
+ <translation>Sélectionnez le centre de la base du cône.</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cone:base_point:GeomValidators_ConstructionComposite</name>
+ <message>
+ <source>The result is empty</source>
+ <translation>Le résultat est vide</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>Cylinder</name>
+ <message>
+ <source>Create a cylinder</source>
+ <translation>Créer un cylindre</translation>
+ </message>
+ <message>
+ <source>Cylinder</source>
+ <translation>Cylindre</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cylinder:CreationMethod</name>
+ <message>
+ <source>Cylinder</source>
+ <translation>Cylindre</translation>
+ </message>
+ <message>
+ <source>Portion of cylinder</source>
+ <translation>Portion de cylindre</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cylinder:angle</name>
+ <message>
+ <source>Enter the angle of the portion of the cylinder</source>
+ <translation>Entrez l'angle de la portion du cylindre</translation>
+ </message>
+ <message>
+ <source>angle</source>
+ <translation>angle</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cylinder:axis</name>
+ <message>
+ <source>Select the axis of the cylinder</source>
+ <translation>Sélectionnez l'axe du cylindre.</translation>
+ </message>
+ <message>
+ <source>Attribute "%1" is not initialized.</source>
+ <translation>Sélectionnez l'axe du cylindre.</translation>
+ </message>
+ <message>
+ <source>axis</source>
+ <translation>axe</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cylinder:base_point</name>
+ <message>
+ <source>Select the center of the base of the cylinder</source>
+ <translation>Sélectionnez le centre de la base du cylindre</translation>
+ </message>
+ <message>
+ <source>base_point</source>
+ <translation>point de base</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cylinder:height</name>
+ <message>
+ <source>Enter the height of the cylinder</source>
+ <translation>Entrez la hauteur du cylindre</translation>
+ </message>
+ <message>
+ <source>height</source>
+ <translation>hauteur</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cylinder:radius</name>
+ <message>
+ <source>Enter the radius of the cylinder</source>
+ <translation>Entrez le rayon du cylindre</translation>
+ </message>
+ <message>
+ <source>radius</source>
+ <translation>rayon</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cylinder:base_point</name>
+ <message>
+ <source>Attribute "%1" is not initialized.</source>
+ <translation>Sélectionnez le centre de la base du cylindre.</translation>
+ </message>
+ </context>
+ <context>
+ <name>Cylinder:base_point:GeomValidators_ConstructionComposite</name>
+ <message>
+ <source>The result is empty</source>
+ <translation>Le résultat est vide</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>Sphere</name>
+ <message>
+ <source>Create a sphere</source>
+ <translation>Créer une sphère</translation>
+ </message>
+ <message>
+ <source>Sphere</source>
+ <translation>Sphère</translation>
+ </message>
+ </context>
+ <context>
+ <name>Sphere:center_point</name>
+ <message>
+ <source>Center point</source>
+ <translation>Point central</translation>
+ </message>
+ <message>
+ <source>Select a center point</source>
+ <translation>Sélectionnez un point central.</translation>
+ </message>
+ <message>
+ <source>Attribute "%1" is not initialized.</source>
+ <translation>Sélectionnez un point central.</translation>
+ </message>
+ </context>
+ <context>
+ <name>Sphere:radius</name>
+ <message>
+ <source>Enter a radius</source>
+ <translation>Entrez un rayon</translation>
+ </message>
+ <message>
+ <source>Radius</source>
+ <translation>Rayon</translation>
+ </message>
+ </context>
+
+ <context>
+ <name>Torus</name>
+ <message>
+ <source>Create a Torus</source>
+ <translation>Créer un tore</translation>
+ </message>
+ <message>
+ <source>Torus</source>
+ <translation>Tore</translation>
+ </message>
+ </context>
+ <context>
+ <name>Torus:axis</name>
+ <message>
+ <source>Select the axis of the torus</source>
+ <translation>Sélectionnez l'axe du tore.</translation>
+ </message>
+ <message>
+ <source>Attribute "%1" is not initialized.</source>
+ <translation>Sélectionnez l'axe du tore.</translation>
+ </message>
+ <message>
+ <source>axis</source>
+ <translation>axe</translation>
+ </message>
+ </context>
+ <context>
+ <name>Torus:base_point</name>
+ <message>
+ <source>Select the center of the torus</source>
+ <translation>Sélectionnez le centre du tore.</translation>
+ </message>
+ <message>
+ <source>Attribute "%1" is not initialized.</source>
+ <translation>Sélectionnez le centre du tore.</translation>
+ </message>
+ <message>
+ <source>base_point</source>
+ <translation>point de base</translation>
+ </message>
+ </context>
+ <context>
+ <name>Torus:radius</name>
+ <message>
+ <source>Enter the radius of the torus</source>
+ <translation>Entrez le rayon du tore</translation>
+ </message>
+ <message>
+ <source>Radius</source>
+ <translation>Rayon</translation>
+ </message>
+ </context>
+ <context>
+ <name>Torus:ring_radius</name>
+ <message>
+ <source>Enter the ring radius of the torus</source>
+ <translation>Entrez le rayon de l'anneau du tore</translation>
+ </message>
+ <message>
+ <source>Ring radius</source>
+ <translation>Rayon de l'anneau</translation>
+ </message>
+ </context>
+
+</TS>
--- /dev/null
+<source>
+ <stringvalue id="medium"
+ label="Medium"
+ tooltip="Please input the volumes medium">
+ </stringvalue>
+ <multi_selector id="volume_list"
+ label="Select solids"
+ tooltip="Select solid objects"
+ shape_types="Solids">
+ <validator id="GeomValidators_BodyShapes"/>
+ </multi_selector>
+</source>
--- /dev/null
+.. |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.
--- /dev/null
+<plugin>
+ <workbench id="Opera" document="Part">
+ <group id="Opera">
+ <feature id="addVolume" title="addVolume" tooltip="Create a volume" icon="icons/Opera/addVolume.png"
+ helpfile="addvolumeFeature.html">
+ <source path="addvolume_widget.xml"/>
+ </feature>
+ </group>
+ </workbench>
+</plugin>
ResultBodyPtr aResultBox = document()->createBody(data(), aResultIndex);
loadNamingDS(aBoxAlgo, aResultBox);
setResult(aResultBox, aResultIndex);
- setVolume(aResultBox, aResultIndex);
}
//=================================================================================================