X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSelector%2FSelector_NExplode.h;h=c939bfa6d2ac167913458a106f9045be38e01af5;hb=refs%2Fheads%2FV9_11_BR;hp=849a3c2918ed27452b210c84b0c83b7c6a37f7cd;hpb=50a8df0c6a66da8067b16155e5ae39f8f26a7ebc;p=modules%2Fshaper.git diff --git a/src/Selector/Selector_NExplode.h b/src/Selector/Selector_NExplode.h index 849a3c291..c939bfa6d 100644 --- a/src/Selector/Selector_NExplode.h +++ b/src/Selector/Selector_NExplode.h @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2020 CEA/DEN, EDF R&D +// Copyright (C) 2017-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 @@ -23,7 +23,10 @@ #include "Selector.h" #include -#include + +#include + +class GeomAlgoAPI_NExplode; /// \class Selector_NExplode /// \ingroup DataModel @@ -34,17 +37,22 @@ class Selector_NExplode { public: /// \brief Initializes the sorted list of shapes by the shapes list. - SELECTOR_EXPORT Selector_NExplode(const TopoDS_ListOfShape& theShapes); + SELECTOR_EXPORT Selector_NExplode(const TopoDS_ListOfShape& theShapes, + const bool theOldOrder = false); /// \brief Initializes the sorted list of shapes by the context shape and type of sub-shapes. - SELECTOR_EXPORT Selector_NExplode(const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theType); + SELECTOR_EXPORT Selector_NExplode(const TopoDS_Shape& theShape, + const TopAbs_ShapeEnum theType, + const bool theOldOrder = false); /// Returns an index (started from one) of sub-shape in the sorted list. Returns 0 if not found. SELECTOR_EXPORT int index(const TopoDS_Shape& theSubShape); /// Returns a shape by an index (started from one). Returns null if not found. - SELECTOR_EXPORT TopoDS_Shape shape(const int theIndex); + /// Recompute the index if the old order was used. The value will contain the new ordered index. + SELECTOR_EXPORT TopoDS_Shape shape(int& theIndex); protected: - TopoDS_ListOfShape mySorted; ///< keep the ordered list of shapes + std::shared_ptr mySorted; ///< keep the ordered list of shapes + bool myToBeReordered; ///< the list has to be reordered }; #endif