b311480e |
1 | // Created by: CKY / Contract Toubro-Larsen |
2 | // Copyright (c) 1993-1999 Matra Datavision |
3 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
7fd59977 |
9 | // |
b311480e |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
7fd59977 |
12 | // |
b311480e |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
20 | //-------------------------------------------------------------------- |
7fd59977 |
21 | //-------------------------------------------------------------------- |
22 | |
23 | #include <IGESAppli_ToolPartNumber.ixx> |
24 | #include <IGESData_ParamCursor.hxx> |
25 | #include <TCollection_HAsciiString.hxx> |
26 | #include <Interface_Macros.hxx> |
27 | #include <IGESData_Dump.hxx> |
28 | |
29 | |
30 | IGESAppli_ToolPartNumber::IGESAppli_ToolPartNumber () { } |
31 | |
32 | |
33 | void IGESAppli_ToolPartNumber::ReadOwnParams |
34 | (const Handle(IGESAppli_PartNumber)& ent, |
35 | const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const |
36 | { |
37 | //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed |
38 | Standard_Integer tempNbPropertyValues; |
39 | Handle(TCollection_HAsciiString) tempGenericNumber; |
40 | Handle(TCollection_HAsciiString) tempMilitaryNumber; |
41 | Handle(TCollection_HAsciiString) tempVendorNumber; |
42 | Handle(TCollection_HAsciiString) tempInternalNumber; |
43 | |
44 | //szv#4:S4163:12Mar99 `st=` not needed |
45 | if (PR.DefinedElseSkip()) |
46 | PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropertyValues); |
47 | else |
48 | tempNbPropertyValues = 4; |
49 | |
50 | PR.ReadText(PR.Current(), "Generic Number or Name", tempGenericNumber); |
51 | PR.ReadText(PR.Current(), "Military Number or Name", tempMilitaryNumber); |
52 | PR.ReadText(PR.Current(), "Vendor Number or Name", tempVendorNumber); |
53 | PR.ReadText(PR.Current(), "Internal Number or Name", tempInternalNumber); |
54 | DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); |
55 | ent->Init(tempNbPropertyValues, tempGenericNumber, |
56 | tempMilitaryNumber, tempVendorNumber, tempInternalNumber); |
57 | } |
58 | |
59 | void IGESAppli_ToolPartNumber::WriteOwnParams |
60 | (const Handle(IGESAppli_PartNumber)& ent, IGESData_IGESWriter& IW) const |
61 | { |
62 | IW.Send(ent->NbPropertyValues()); |
63 | IW.Send(ent->GenericNumber()); |
64 | IW.Send(ent->MilitaryNumber()); |
65 | IW.Send(ent->VendorNumber()); |
66 | IW.Send(ent->InternalNumber()); |
67 | } |
68 | |
69 | void IGESAppli_ToolPartNumber::OwnShared |
70 | (const Handle(IGESAppli_PartNumber)& /* ent */, Interface_EntityIterator& /* iter */) const |
71 | { |
72 | } |
73 | |
74 | void IGESAppli_ToolPartNumber::OwnCopy |
75 | (const Handle(IGESAppli_PartNumber)& another, |
76 | const Handle(IGESAppli_PartNumber)& ent, Interface_CopyTool& /* TC */) const |
77 | { |
78 | Standard_Integer tempNbPropertyValues = another->NbPropertyValues(); |
79 | Handle(TCollection_HAsciiString) tempGenericNumber = |
80 | new TCollection_HAsciiString(another->GenericNumber()); |
81 | Handle(TCollection_HAsciiString) tempMilitaryNumber = |
82 | new TCollection_HAsciiString(another->MilitaryNumber()); |
83 | Handle(TCollection_HAsciiString) tempVendorNumber = |
84 | new TCollection_HAsciiString(another->VendorNumber()); |
85 | Handle(TCollection_HAsciiString) tempInternalNumber = |
86 | new TCollection_HAsciiString(another->InternalNumber()); |
87 | ent->Init(tempNbPropertyValues, tempGenericNumber, tempMilitaryNumber, |
88 | tempVendorNumber, tempInternalNumber); |
89 | } |
90 | |
91 | Standard_Boolean IGESAppli_ToolPartNumber::OwnCorrect |
92 | (const Handle(IGESAppli_PartNumber)& ent) const |
93 | { |
94 | Standard_Boolean res = (ent->NbPropertyValues() != 4); |
95 | if (res) ent->Init |
96 | (4,ent->GenericNumber(),ent->MilitaryNumber(),ent->VendorNumber(), |
97 | ent->InternalNumber()); // nbpropertyvalues= 4 |
98 | return res; |
99 | } |
100 | |
101 | IGESData_DirChecker IGESAppli_ToolPartNumber::DirChecker |
102 | (const Handle(IGESAppli_PartNumber)& /* ent */ ) const |
103 | { |
104 | IGESData_DirChecker DC(406, 9); |
105 | DC.Structure(IGESData_DefVoid); |
106 | DC.GraphicsIgnored(); |
107 | DC.LineFont(IGESData_DefVoid); |
108 | DC.LineWeight(IGESData_DefVoid); |
109 | DC.Color(IGESData_DefVoid); |
110 | DC.BlankStatusIgnored(); |
111 | DC.UseFlagIgnored(); |
112 | DC.HierarchyStatusIgnored(); |
113 | return DC; |
114 | } |
115 | |
116 | void IGESAppli_ToolPartNumber::OwnCheck |
117 | (const Handle(IGESAppli_PartNumber)& ent, |
118 | const Interface_ShareTool& , Handle(Interface_Check)& ach) const |
119 | { |
120 | if (ent->NbPropertyValues() != 4) |
121 | ach->AddFail("Number of property values != 4"); |
122 | } |
123 | |
124 | void IGESAppli_ToolPartNumber::OwnDump |
125 | (const Handle(IGESAppli_PartNumber)& ent, const IGESData_IGESDumper& /* dumper */, |
126 | const Handle(Message_Messenger)& S, const Standard_Integer /* level */) const |
127 | { |
128 | //Standard_Integer sublevel = (level > 4) ? 1 : 0; //szv#4:S4163:12Mar99 unused |
129 | S << "IGESAppli_PartNumber" << endl; |
130 | S << "Number of property values : " << ent->NbPropertyValues() << endl; |
131 | S << "Generic Number or Name : "; |
132 | IGESData_DumpString(S,ent->GenericNumber()); |
133 | S << endl; |
134 | S << "Military Number or Name : "; |
135 | IGESData_DumpString(S,ent->MilitaryNumber()); |
136 | S << endl; |
137 | S << "Vendor Number or Name : "; |
138 | IGESData_DumpString(S,ent->VendorNumber()); |
139 | S << endl; |
140 | S << "Internal Number or Name : "; |
141 | IGESData_DumpString(S,ent->InternalNumber()); |
142 | S << endl; |
143 | } |