Salome HOME
Some minor changes in tests. Now the initialization plugin performs correctly in...
[modules/shaper.git] / src / Model / Model_SelectionNaming.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        Model_SelectionNaming.h
4 // Created:     11 Aug 2015
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef Model_SelectionNaming_H_
8 #define Model_SelectionNaming_H_
9
10 #include <ModelAPI_Result.h>
11 #include <GeomAPI_Shape.h>
12 #include <Model_Document.h>
13 #include <TDF_Label.hxx>
14 #include <TopoDS_Shape.hxx>
15
16 /**\class Model_SelectionNaming
17  * \ingroup DataModel
18  * \brief The set of methods that allow to generate a string-name for the selection attribute.
19  */
20
21 class Model_SelectionNaming
22 {
23   TDF_Label myLab; ///< Selection label of the selection attribute
24 public:
25   /// Constructor for the selection attribute by the selection label
26   Model_SelectionNaming(TDF_Label theSelectionLab);
27
28   /// Produces the string-name for the selected shape
29   std::string namingName(ResultPtr& theContext, std::shared_ptr<GeomAPI_Shape> theSubSh,
30     const std::string& theDefaultName);
31   
32   /// Makes a selection by the string-name
33   /// \param theType string of the type of the shape
34   /// \param theSubShapeName string-identifier of the selected shape
35   /// \param theDoc document where the selected shape is searched
36   /// \param theShapeToBeSelected resulting selected shape
37   /// \param theCont the selection context of the resulting selected shape
38   bool selectSubShape(const std::string& theType, const std::string& theSubShapeName,
39     std::shared_ptr<Model_Document> theDoc, std::shared_ptr<GeomAPI_Shape>& theShapeToBeSelected,
40     std::shared_ptr<ModelAPI_Result>& theCont);
41
42 protected:
43   /// Gets the stored name from the document
44   std::string getShapeName(std::shared_ptr<Model_Document> theDoc, const TopoDS_Shape& theShape);
45 };
46
47 #endif