1 // Created on: 1992-11-17
2 // Created by: Christian CAILLET
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IFSelect_Selection_HeaderFile
18 #define _IFSelect_Selection_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <MMgt_TShared.hxx>
24 #include <Standard_Boolean.hxx>
25 class Interface_InterfaceError;
26 class Interface_EntityIterator;
27 class Interface_Graph;
28 class IFSelect_SelectionIterator;
29 class TCollection_AsciiString;
32 class IFSelect_Selection;
33 DEFINE_STANDARD_HANDLE(IFSelect_Selection, MMgt_TShared)
35 //! A Selection allows to define a set of Interface Entities.
36 //! Entities to be put on an output file should be identified in
37 //! a way as independant from such or such execution as possible.
38 //! This permits to handle comprehensive criteria, and to replay
39 //! them when a new variant of an input file has to be processed.
41 //! Its input can be, either an Interface Model (the very source),
42 //! or another-other Selection(s) or any other ouput. All list
43 //! computations start from an input Graph (from IFGraph)
44 class IFSelect_Selection : public MMgt_TShared
50 //! Returns the list of selected entities, computed from Input
51 //! given as a Graph. Specific to each class of Selection
52 //! Note that uniqueness of each entity is not required here
53 //! This method can raise an exception as necessary
54 Standard_EXPORT virtual Interface_EntityIterator RootResult (const Interface_Graph& G) const = 0;
56 //! Returns the list of selected entities, each of them beeing
57 //! unique. Default definition works from RootResult. According
58 //! HasUniqueResult, UniqueResult returns directly RootResult,
59 //! or build a Unique Result from it with a Graph.
60 Standard_EXPORT Interface_EntityIterator UniqueResult (const Interface_Graph& G) const;
62 //! Returns the list of entities involved by a Selection, i.e.
63 //! UniqueResult plus the shared entities (directly or not)
64 Standard_EXPORT virtual Interface_EntityIterator CompleteResult (const Interface_Graph& G) const;
66 //! Puts in an Iterator the Selections from which "me" depends
67 //! (there can be zero, or one, or a list).
68 //! Specific to each class of Selection
69 Standard_EXPORT virtual void FillIterator (IFSelect_SelectionIterator& iter) const = 0;
71 //! Returns a text which defines the criterium applied by a
72 //! Selection (can be used to be printed, displayed ...)
73 //! Specific to each class
74 Standard_EXPORT virtual TCollection_AsciiString Label() const = 0;
79 DEFINE_STANDARD_RTTI(IFSelect_Selection,MMgt_TShared)
84 //! Returns True if RootResult guarantees uniqueness for each
85 //! Entity. Called by UniqueResult.
86 //! Default answer is False. Can be redefined.
87 Standard_EXPORT virtual Standard_Boolean HasUniqueResult() const;
104 #endif // _IFSelect_Selection_HeaderFile