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