b311480e |
1 | // Created by: CKY / Contract Toubro-Larsen |
2 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
3 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
7fd59977 |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
7fd59977 |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
16 | //-------------------------------------------------------------------- |
7fd59977 |
17 | //-------------------------------------------------------------------- |
18 | |
42cf5bc1 |
19 | #include <IGESBasic_AssocGroupType.hxx> |
20 | #include <IGESBasic_ToolAssocGroupType.hxx> |
21 | #include <IGESData_DirChecker.hxx> |
22 | #include <IGESData_Dump.hxx> |
23 | #include <IGESData_IGESDumper.hxx> |
24 | #include <IGESData_IGESReaderData.hxx> |
25 | #include <IGESData_IGESWriter.hxx> |
7fd59977 |
26 | #include <IGESData_ParamCursor.hxx> |
42cf5bc1 |
27 | #include <IGESData_ParamReader.hxx> |
28 | #include <Interface_Check.hxx> |
29 | #include <Interface_CopyTool.hxx> |
30 | #include <Interface_EntityIterator.hxx> |
7fd59977 |
31 | #include <Interface_Macros.hxx> |
42cf5bc1 |
32 | #include <Interface_ShareTool.hxx> |
33 | #include <Message_Messenger.hxx> |
34 | #include <Standard_DomainError.hxx> |
35 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
36 | |
37 | IGESBasic_ToolAssocGroupType::IGESBasic_ToolAssocGroupType () { } |
38 | |
39 | |
40 | void IGESBasic_ToolAssocGroupType::ReadOwnParams |
41 | (const Handle(IGESBasic_AssocGroupType)& ent, |
42 | const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const |
43 | { |
44 | //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed |
45 | Standard_Integer tempNbData; |
46 | Standard_Integer tempType; |
47 | Handle(TCollection_HAsciiString) tempName; |
48 | if (PR.DefinedElseSkip()) |
49 | PR.ReadInteger(PR.Current(), "Number of data fields", tempNbData); //szv#4:S4163:12Mar99 `st=` not needed |
50 | else |
51 | tempNbData = 2; |
52 | PR.ReadInteger(PR.Current(), "Type of attached associativity",tempType); //szv#4:S4163:12Mar99 `st=` not needed |
53 | PR.ReadText(PR.Current(), "Name of attached associativity", tempName); //szv#4:S4163:12Mar99 `st=` not needed |
54 | DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); |
55 | ent->Init(tempNbData, tempType, tempName); |
56 | } |
57 | |
58 | void IGESBasic_ToolAssocGroupType::WriteOwnParams |
59 | (const Handle(IGESBasic_AssocGroupType)& ent, IGESData_IGESWriter& IW) const |
60 | { |
61 | IW.Send(ent->NbData()); |
62 | IW.Send(ent->AssocType()); |
63 | IW.Send(ent->Name()); |
64 | } |
65 | |
66 | void IGESBasic_ToolAssocGroupType::OwnShared |
67 | (const Handle(IGESBasic_AssocGroupType)& /* ent */, Interface_EntityIterator& /* iter */) const |
68 | { |
69 | } |
70 | |
71 | void IGESBasic_ToolAssocGroupType::OwnCopy |
72 | (const Handle(IGESBasic_AssocGroupType)& another, |
73 | const Handle(IGESBasic_AssocGroupType)& ent, Interface_CopyTool& /* TC */) const |
74 | { |
75 | Standard_Integer tempNbData = another->NbData(); |
76 | Standard_Integer tempType = another->AssocType(); |
77 | Handle(TCollection_HAsciiString) tempName = |
78 | new TCollection_HAsciiString(another->Name()); |
79 | ent->Init(tempNbData, tempType, tempName); |
80 | } |
81 | |
82 | Standard_Boolean IGESBasic_ToolAssocGroupType::OwnCorrect |
83 | (const Handle(IGESBasic_AssocGroupType)& ent) const |
84 | { |
85 | Standard_Boolean res = (ent->NbData() != 2); |
86 | if (res) ent->Init(2,ent->AssocType(),ent->Name()); |
87 | return res; // nbdata=2 |
88 | } |
89 | |
90 | IGESData_DirChecker IGESBasic_ToolAssocGroupType::DirChecker |
91 | (const Handle(IGESBasic_AssocGroupType)& /* ent */ ) const |
92 | { |
93 | IGESData_DirChecker DC(406, 23); |
94 | DC.Structure(IGESData_DefVoid); |
95 | DC.GraphicsIgnored(); |
96 | DC.LineFont(IGESData_DefVoid); |
97 | DC.LineWeight(IGESData_DefVoid); |
98 | DC.Color(IGESData_DefVoid); |
99 | DC.BlankStatusIgnored(); |
100 | DC.UseFlagIgnored(); |
101 | DC.HierarchyStatusIgnored(); |
102 | return DC; |
103 | } |
104 | |
105 | void IGESBasic_ToolAssocGroupType::OwnCheck |
106 | (const Handle(IGESBasic_AssocGroupType)& ent, |
107 | const Interface_ShareTool& , Handle(Interface_Check)& ach) const |
108 | { |
109 | if (ent->NbData() != 2) |
110 | ach->AddFail("Number of data fields != 2"); |
111 | } |
112 | |
113 | void IGESBasic_ToolAssocGroupType::OwnDump |
114 | (const Handle(IGESBasic_AssocGroupType)& ent, const IGESData_IGESDumper& /* dumper */, |
115 | const Handle(Message_Messenger)& S, const Standard_Integer /* level */) const |
116 | { |
117 | S << "IGESBasic_AssocGroupType" << endl; |
118 | S << "Number of data fields : " << ent->NbData() << endl; |
119 | S << "Type of attached associativity : " << ent->AssocType() << endl; |
120 | S << "Name of attached associativity : "; |
121 | IGESData_DumpString(S,ent->Name()); |
122 | S << endl; |
123 | } |