X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_AttributeSelection.h;h=9a0c58d6744db357455c656b224fc0e6a7912b77;hb=refs%2Fheads%2FCR35150;hp=5343ecfbd6052b338771bccb2f2a443ae2f8e5e4;hpb=1e2eaa713f139d2617c80eba9ede62d4e9976bb7;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_AttributeSelection.h b/src/ModelAPI/ModelAPI_AttributeSelection.h index 5343ecfbd..9a0c58d67 100644 --- a/src/ModelAPI/ModelAPI_AttributeSelection.h +++ b/src/ModelAPI/ModelAPI_AttributeSelection.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef ModelAPI_AttributeSelection_H_ @@ -25,6 +24,7 @@ #include class GeomAPI_Edge; +class GeomAPI_Pnt; /**\class ModelAPI_AttributeSelection * \ingroup DataModel @@ -34,7 +34,7 @@ class GeomAPI_Edge; class ModelAPI_AttributeSelection : public ModelAPI_Attribute { public: - /// Type of the center of the circular of elliptical edge + /// Type of the center of the circular of elliptic edge enum CenterType { NOT_CENTER, ///< this is not a center CIRCLE_CENTER, ///< center of the circle @@ -46,13 +46,13 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute /// \param theContext object where the sub-shape was selected /// \param theSubShape selected sub-shape (if null, the whole context is selected) /// \param theTemporarily if it is true, do not store and name the added in the data framework - /// (used to remove immideately, without the following updates) + /// (used to remove immediately, without the following updates) /// \returns true if attribute was updated virtual bool setValue( const ObjectPtr& theContext, const std::shared_ptr& theSubShape, const bool theTemporarily = false) = 0; - /// Same as SetValue, but it takes an edge (on circular or elliptical curve) + /// Same as SetValue, but it takes an edge (on circular or elliptic curve) /// and stores the vertex of the central point (for ellipse the first or the second focus point) virtual void setValueCenter( const ObjectPtr& theContext, const std::shared_ptr& theEdge, @@ -77,7 +77,7 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute /// Returns the context of the selection : result or feature virtual std::shared_ptr contextObject() = 0; - /// Updates the underlied selection due to the changes in the referenced objects + /// Updates the selection due to the changes in the referenced objects /// \returns false if update is failed virtual bool update() = 0; @@ -92,23 +92,42 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute /// Returns a textual string of the selection /// \param theDefaultValue a value, which is used if the naming name can not be obtained - virtual std::string namingName(const std::string& theDefaultValue = "") = 0; - - /// Returns an id of the selection - virtual int Id() = 0; + virtual std::wstring namingName(const std::wstring& theDefaultValue = L"") = 0; /// Defines an id of the selection virtual void setId(int theID) = 0; /// Selects sub-shape by the textual Name - virtual void selectSubShape(const std::string& theType, const std::string& theSubShapeName) = 0; + virtual void selectSubShape(const std::string& theType, const std::wstring& theSubShapeName) = 0; + + /// Selects sub-shape by its inner point + virtual void selectSubShape(const std::string& theType, + const std::shared_ptr& thePoint) = 0; + + /// Selects sub-shape by weak naming index + virtual void selectSubShape(const std::string& theType, + const std::wstring& theContextName, const int theIndex) = 0; /// Returns true if recompute of selection become impossible virtual bool isInvalid() = 0; + /// Returns true if is geometrical selection. + virtual bool isGeometricalSelection() const = 0; + /// To virtually destroy the fields of successors MODELAPI_EXPORT virtual ~ModelAPI_AttributeSelection(); + /// Returns the name by context. Adds the part name if the context is located in other document + MODELAPI_EXPORT virtual std::wstring contextName(const ResultPtr& theContext) const = 0; + + /// Makes the current local selection becomes all sub-shapes with same base geometry. + MODELAPI_EXPORT virtual void combineGeometrical() = 0; + + /// Updates the arguments of selection if something was affected by creation + /// or reorder of features upper in the history line. + /// Returns theRemove true if this attribute must be removed (become deleted) + MODELAPI_EXPORT virtual void updateInHistory(bool& theRemove) = 0; + protected: /// Objects are created for features automatically MODELAPI_EXPORT ModelAPI_AttributeSelection();