1 -- Created on: 1992-12-02
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 class SelectRootComps from IFSelect inherits SelectExtract
25 ---Purpose : A SelectRootComps sorts the Entities which are part of Strong
26 -- Componants, local roots of a set of Entities : they can be
27 -- Single Componants (containing one Entity) or Cycles
28 -- This class gives a more secure result than SelectRoots (which
29 -- considers only Single Componants) but is longer to work : it
30 -- can be used when there can be or there are cycles in a Model
31 -- For each cycle, one Entity is given arbitrarily
32 -- Reject works as for SelectRoots : Strong Componants defined in
33 -- the input list which are not local roots are given
35 uses AsciiString from TCollection, InterfaceModel, EntityIterator, Graph
39 Create returns mutable SelectRootComps;
40 ---Purpose : Creates a SelectRootComps
42 RootResult (me; G : Graph) returns EntityIterator is redefined;
43 ---Purpose : Returns the list of local root strong componants, by one
44 -- Entity par componant. It is redefined for a purpose of
45 -- effeciency : calling a Sort routine for each Entity would
46 -- cost more ressource than to work in once using a Map
47 -- RootResult takes in account the Direct status
49 HasUniqueResult (me) returns Boolean is redefined protected;
50 ---Purpose : Returns True, RootResult assuring uniqueness
52 Sort (me; rank : Integer; ent : Transient; model : InterfaceModel)
54 ---Purpose : Returns always True, because RootResult has done work
56 ExtractLabel (me) returns AsciiString from TCollection;
57 ---Purpose : Returns a text defining the criterium : "Local Root Componants"