42cf5bc1 |
1 | // Created on: 1992-12-02 |
2 | // Created by: Christian CAILLET |
3 | // Copyright (c) 1992-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _IFSelect_SelectRootComps_HeaderFile |
18 | #define _IFSelect_SelectRootComps_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <IFSelect_SelectExtract.hxx> |
24 | #include <Standard_Boolean.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | class Interface_EntityIterator; |
27 | class Interface_Graph; |
28 | class Standard_Transient; |
29 | class Interface_InterfaceModel; |
30 | class TCollection_AsciiString; |
31 | |
32 | |
33 | class IFSelect_SelectRootComps; |
34 | DEFINE_STANDARD_HANDLE(IFSelect_SelectRootComps, IFSelect_SelectExtract) |
35 | |
36 | //! A SelectRootComps sorts the Entities which are part of Strong |
37 | //! Componants, local roots of a set of Entities : they can be |
38 | //! Single Componants (containing one Entity) or Cycles |
39 | //! This class gives a more secure result than SelectRoots (which |
40 | //! considers only Single Componants) but is longer to work : it |
41 | //! can be used when there can be or there are cycles in a Model |
42 | //! For each cycle, one Entity is given arbitrarily |
43 | //! Reject works as for SelectRoots : Strong Componants defined in |
44 | //! the input list which are not local roots are given |
45 | class IFSelect_SelectRootComps : public IFSelect_SelectExtract |
46 | { |
47 | |
48 | public: |
49 | |
50 | |
51 | //! Creates a SelectRootComps |
52 | Standard_EXPORT IFSelect_SelectRootComps(); |
53 | |
54 | //! Returns the list of local root strong componants, by one |
55 | //! Entity par componant. It is redefined for a purpose of |
56 | //! effeciency : calling a Sort routine for each Entity would |
57 | //! cost more ressource than to work in once using a Map |
58 | //! RootResult takes in account the Direct status |
59 | Standard_EXPORT virtual Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; |
60 | |
61 | //! Returns always True, because RootResult has done work |
79104795 |
62 | Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; |
42cf5bc1 |
63 | |
64 | //! Returns a text defining the criterium : "Local Root Componants" |
79104795 |
65 | Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; |
42cf5bc1 |
66 | |
67 | |
68 | |
69 | |
92efcf78 |
70 | DEFINE_STANDARD_RTTIEXT(IFSelect_SelectRootComps,IFSelect_SelectExtract) |
42cf5bc1 |
71 | |
72 | protected: |
73 | |
74 | |
75 | //! Returns True, RootResult assuring uniqueness |
76 | Standard_EXPORT virtual Standard_Boolean HasUniqueResult() const Standard_OVERRIDE; |
77 | |
78 | |
79 | |
80 | private: |
81 | |
82 | |
83 | |
84 | |
85 | }; |
86 | |
87 | |
88 | |
89 | |
90 | |
91 | |
92 | |
93 | #endif // _IFSelect_SelectRootComps_HeaderFile |