b311480e |
1 | -- Created on: 1995-08-25 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1995-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 | -- |
d5f74e42 |
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 |
973c2be1 |
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 BasicEditor from IGESData |
18 | |
19 | ---Purpose : This class provides various functions of basic edition, |
20 | -- such as : |
21 | -- - setting header unit (WARNING : DOES NOT convert entities) |
22 | -- - computation of the status (Subordinate, UseFlag) of entities |
23 | -- of IGES Entities on a whole model |
24 | -- - auto correction of IGES Entities, defined both by DirChecker |
25 | -- and by specific service AutoCorrect |
26 | -- (this auto correction performs non-ambigious, rather logic, |
27 | -- editions) |
28 | |
29 | uses GeneralLib, SpecificLib, |
30 | IGESModel, IGESEntity, Protocol from IGESData |
31 | |
32 | is |
33 | |
34 | Create (protocol : Protocol from IGESData) returns BasicEditor; |
35 | ---Purpose : Creates a Basic Editor, with a new IGESModel, ready to run |
36 | |
37 | Create (model : IGESModel; protocol : Protocol from IGESData) |
38 | returns BasicEditor; |
39 | ---Purpose : Creates a Basic Editor for IGES Data, ready to run |
40 | |
6e33d3ce |
41 | Model (me) returns IGESModel; |
7fd59977 |
42 | ---Purpose : Returns the designated model |
43 | |
44 | SetUnitFlag (me : in out; flag : Integer) returns Boolean; |
45 | ---Purpose : Sets a new unit from its flag (param 14 of Global Section) |
46 | -- Returns True if done, False if <flag> is incorrect |
47 | |
48 | SetUnitValue (me : in out; val : Real) returns Boolean; |
49 | ---Purpose : Sets a new unit from its value in meters (rounded to the |
50 | -- closest one, max gap 1%) |
51 | -- Returns True if done, False if <val> is too far from a |
52 | -- suitable value |
53 | |
54 | SetUnitName (me : in out; name : CString) returns Boolean; |
55 | ---Purpose : Sets a new unit from its name (param 15 of Global Section) |
56 | -- Returns True if done, False if <name> is incorrect |
57 | -- Remark : if <flag> has been set to 3 (user defined), <name> |
58 | -- is then free |
59 | |
60 | ApplyUnit (me : in out; enforce : Boolean = Standard_False); |
61 | ---Purpose : Applies unit value to convert header data : Resolution, |
62 | -- MaxCoord, MaxLineWeight |
63 | -- Applies unit only once after SetUnit... has been called, |
64 | -- if <enforce> is given as True. |
65 | -- It can be called just before writing the model to a file, |
66 | -- i.e. when definitive values are finally known |
67 | |
68 | ComputeStatus (me : in out); |
69 | ---Purpose : Performs the re-computation of status on the whole model |
70 | -- (Subordinate Status and Use Flag of each IGES Entity), which |
71 | -- can have required values according the way they are referenced |
72 | -- (see definitions of Logical use, Physical use, etc...) |
73 | |
6e33d3ce |
74 | AutoCorrect (me : in out; ent : IGESEntity) returns Boolean; |
7fd59977 |
75 | ---Purpose : Performs auto-correction on an IGESEntity |
76 | -- Returns True if something has changed, False if nothing done. |
77 | -- |
78 | -- Works with the specific IGES Services : DirChecker which |
79 | -- allows to correct data in "Directory Part" of Entities (such |
80 | -- as required values for status, or references to be null), and |
81 | -- the specific IGES service OwnCorrect, which is specialised for |
82 | -- each type of entity. |
83 | |
84 | AutoCorrectModel (me : in out) returns Integer; |
85 | ---Purpose : Performs auto-correction on the whole Model |
86 | -- Returns the count of modified entities |
87 | |
88 | |
89 | |
90 | UnitNameFlag (myclass; name : CString) returns Integer; |
91 | ---Purpose : From the name of unit, computes flag number, 0 if incorrect |
92 | -- (in this case, user defined entity remains possible) |
93 | |
94 | UnitFlagValue (myclass; flag : Integer) returns Real; |
95 | ---Purpose : From the flag of unit, determines value in MM, 0 if incorrect |
96 | |
97 | UnitFlagName (myclass; flag : Integer) returns CString; |
98 | ---Purpose : From the flag of unit, determines its name, "" if incorrect |
99 | |
100 | IGESVersionName (myclass; flag : Integer) returns CString; |
101 | ---Purpose : From the flag of IGES version, returns name, "" if incorrect |
102 | |
103 | IGESVersionMax (myclass) returns Integer; |
104 | ---Purpose : Returns the maximum allowed value for IGESVersion Flag |
105 | |
106 | DraftingName (myclass; flag : Integer) returns CString; |
107 | ---Purpose : From the flag of drafting standard, returns name, "" if incorrect |
108 | |
109 | DraftingMax (myclass) returns Integer; |
110 | ---Purpose : Returns the maximum allowed value for Drafting Flag |
111 | |
112 | fields |
113 | |
114 | theunit : Boolean; |
115 | theproto : Protocol from IGESData; |
116 | themodel : IGESModel; |
117 | theglib : GeneralLib; |
118 | theslib : SpecificLib; |
119 | |
120 | end BasicEditor; |