X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_Selection.h;h=2a5586e0e7c79e16967de5855d4e148859e2e7f4;hb=88ee9b2b81cf93a6324336b57e30cc8a3a487499;hp=8612a81256884465f831bd860368418fe0b8c861;hpb=caa2ac92b289e88592286da703c871dd58147b88;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.h b/src/ModelHighAPI/ModelHighAPI_Selection.h index 8612a8125..2a5586e0e 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.h +++ b/src/ModelHighAPI/ModelHighAPI_Selection.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2022 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 @@ -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 SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_ @@ -24,6 +23,7 @@ //-------------------------------------------------------------------------------------- #include "ModelHighAPI.h" +#include #include #include #include @@ -32,13 +32,14 @@ class GeomAPI_Pnt; class GeomAPI_Shape; class ModelAPI_AttributeSelection; class ModelAPI_AttributeSelectionList; +class ModelAPI_FiltersFeature; class ModelAPI_Result; //-------------------------------------------------------------------------------------- typedef std::pair, std::shared_ptr > ResultSubShapePair; -typedef std::pair TypeSubShapeNamePair; +typedef std::pair TypeSubShapeNamePair; typedef std::pair > TypeInnerPointPair; -typedef std::pair > TypeWeakNamingPair; +typedef std::pair > TypeWeakNamingPair; //-------------------------------------------------------------------------------------- /**\class ModelHighAPI_Selection * \ingroup CPPHighAPI @@ -52,7 +53,8 @@ public: VT_ResultSubShapePair, VT_TypeSubShapeNamePair, VT_TypeInnerPointPair, - VT_WeakNamingPair + VT_WeakNamingPair, + VT_Filtering }; public: @@ -68,18 +70,23 @@ public: /// Constructor for sub-shape by the textual Name MODELHIGHAPI_EXPORT ModelHighAPI_Selection(const std::string& theType, - const std::string& theSubShapeName); + const std::wstring& theSubShapeName); /// Constructor for sub-shape by inner point coordinates MODELHIGHAPI_EXPORT ModelHighAPI_Selection(const std::string& theType, const std::shared_ptr& theSubShapeInnerPoint); + /// Constructor for sub-shape by inner point coordinates given by a tuple + MODELHIGHAPI_EXPORT + ModelHighAPI_Selection(const std::string& theType, + const std::list& theSubShapeInnerPoint); + /// Constructor for sub-shape by weak naming identifier MODELHIGHAPI_EXPORT ModelHighAPI_Selection(const std::string& theType, - const std::string& theContextName, const int theIndex); + const std::wstring& theContextName, const int theIndex); /// Destructor MODELHIGHAPI_EXPORT @@ -109,21 +116,25 @@ public: MODELHIGHAPI_EXPORT virtual TypeInnerPointPair typeInnerPointPair() const; + /// \return pair of sub-shape type and pair of context name and sub-shape index. + MODELHIGHAPI_EXPORT + virtual TypeWeakNamingPair typeWeakNamingPair() const; + /// \return shape type. MODELHIGHAPI_EXPORT virtual std::string shapeType() const; /// Shortcut for result()->data()->setName() MODELHIGHAPI_EXPORT - void setName(const std::string& theName); + void setName(const std::wstring& theName); /// Shortcut for result()->data()->name() MODELHIGHAPI_EXPORT - std::string name() const; + std::wstring name() const; /// Change result's color MODELHIGHAPI_EXPORT - void setColor(int theRed, int theGreen, int theBlue); + void setColor(int theRed = 0, int theGreen = 0, int theBlue = 0, bool random = false); /// Change result's deflection MODELHIGHAPI_EXPORT @@ -141,12 +152,13 @@ public: MODELHIGHAPI_EXPORT ModelHighAPI_Selection subResult(int theIndex) const; -private: +protected: VariantType myVariantType; ResultSubShapePair myResultSubShapePair; TypeSubShapeNamePair myTypeSubShapeNamePair; TypeInnerPointPair myTypeInnerPointPair; TypeWeakNamingPair myWeakNamingPair; + std::shared_ptr myFilterFeature; }; //--------------------------------------------------------------------------------------