1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_SelectionNaming.h
4 // Created: 11 Aug 2015
5 // Author: Mikhail PONIKAROV
7 #ifndef Model_SelectionNaming_H_
8 #define Model_SelectionNaming_H_
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>
16 /**\class Model_SelectionNaming
18 * \brief The set of methods that allow to generate a string-name for the selection attribute.
21 class Model_SelectionNaming
23 TDF_Label myLab; ///< Selection label of the selection attribute
25 /// Constructor for the selection attribute by the selection label
26 Model_SelectionNaming(TDF_Label theSelectionLab);
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);
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);
43 /// Gets the stored name from the document
44 std::string getShapeName(std::shared_ptr<Model_Document> theDoc, const TopoDS_Shape& theShape);