1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef Selector_Selector_H_
22 #define Selector_Selector_H_
26 #include <TDF_Label.hxx>
27 #include <TDF_LabelList.hxx>
28 #include <TopoDS_Shape.hxx>
30 /**\class Selector_Selector
32 * \brief Main object for selection of the sub-shapes in the parametrically updated
33 * shapes using topological naming mechanism.
36 class Selector_Selector
38 /// Type of a selector: on this type depends what is stored in this label and how to
39 /// restore it on update.
41 SELTYPE_CONTAINER, ///< just a container of sub-elements, keeps the shape type of container
42 SELTYPE_INTERSECT, ///< sub-shape is intersection of higher level objects
43 SELTYPE_PRIMITIVE, ///< sub-shape found as a primitive on some label
47 Selector_Type myType; ///< Type of this selector.
48 TopAbs_ShapeEnum myShapeType; ///< type of this shape: container or result of intersection
49 TDF_Label myFinal; ///< final label of the primitive or generation, where the value is
50 TDF_LabelList myBases; ///< initial labels that contain shapes that produce the modification
52 TDF_Label myLab; ///< main label where selector is performed
55 /// Initializes selector on the label
56 Selector_Selector(TDF_Label theLab);
57 /// Returns label of this selector
60 /// Initializes the selector structure on the label.
61 /// Stores the name data to restore after modification.
62 bool Select(const TopoDS_Shape theContext, const TopoDS_Shape theValue);
64 /// Stores the name to the label and sub-labels tree
67 /// Restores the selected shape by the topological naming kept in the data structure
68 //TopoDS_Shape Restore();