b311480e |
1 | -- Created on: 1992-09-23 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1992-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
973c2be1 |
8 | -- This library is free software; you can redistribute it and / or modify it |
9 | -- under the terms of the GNU Lesser General Public 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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class Compare from IFGraph inherits GraphContent |
18 | |
19 | ---Purpose : this class evaluates effect of two compared sub-parts : |
20 | -- cumulation (union), common part (intersection-overlapping) |
21 | -- part specific to first sub-part or to the second one |
22 | -- Results are kept in a Graph, several question can be set |
23 | -- Basic Iteration gives Cumulation (union) |
24 | |
25 | uses Transient, EntityIterator, Graph |
26 | |
27 | is |
28 | |
29 | Create (agraph : Graph) returns Compare; |
30 | ---Purpose : creates empty Compare, ready to work |
31 | |
32 | GetFromEntity (me : in out; ent : any Transient; first : Boolean); |
33 | ---Purpose : adds an entity and its shared ones to the list : |
34 | -- first True means adds to the first sub-list, else to the 2nd |
35 | |
36 | GetFromIter (me : in out; iter : EntityIterator; first : Boolean); |
37 | ---Purpose : adds a list of entities (as an iterator) as such, that is, |
38 | -- their shared entities are not considered (use AllShared to |
39 | -- have them) |
40 | -- first True means adds to the first sub-list, else to the 2nd |
41 | |
42 | Merge (me : in out); |
43 | ---Purpose : merges the second list into the first one, hence the second |
44 | -- list is empty |
45 | |
46 | RemoveSecond (me : in out); |
47 | ---Purpose : Removes the contents of second list |
48 | |
49 | KeepCommon (me : in out); |
50 | ---Purpose : Keeps only Common part, sets it as First list and clears |
51 | -- second list |
52 | |
53 | ResetData (me : in out); |
54 | ---Purpose : Allows to restart on a new data set |
55 | |
56 | -- -- Results -- -- |
57 | -- More-Next-Value-Entity give all entities taken into the Cumulation |
58 | -- other informations are provided, as EntityIterator : hence they |
59 | -- are available for other evaluations |
60 | |
61 | Evaluate (me : in out) is redefined; |
62 | ---Purpose : Recomputes result of comparing to sub-parts |
63 | |
64 | Common (me) returns EntityIterator; |
65 | ---Purpose : returns entities common to the both parts |
66 | |
67 | FirstOnly (me) returns EntityIterator; |
68 | ---Purpose : returns entities which are exclusively in the first list |
69 | |
70 | SecondOnly (me) returns EntityIterator; |
71 | ---Purpose : returns entities which are exclusively in the second part |
72 | |
73 | fields |
74 | |
75 | thegraph : Graph; |
76 | |
77 | end Compare; |