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_ToolPinNumber.ixx> |
24 | #include <IGESData_ParamCursor.hxx> |
25 | #include <TCollection_HAsciiString.hxx> |
26 | #include <IGESData_LevelListEntity.hxx> |
27 | #include <Interface_Macros.hxx> |
28 | #include <IGESData_Dump.hxx> |
29 | |
30 | |
31 | IGESAppli_ToolPinNumber::IGESAppli_ToolPinNumber () { } |
32 | |
33 | |
34 | void IGESAppli_ToolPinNumber::ReadOwnParams |
35 | (const Handle(IGESAppli_PinNumber)& ent, |
36 | const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const |
37 | { |
38 | Standard_Integer tempNbPropertyValues; |
39 | Handle(TCollection_HAsciiString) tempPinNumber; |
40 | //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed |
41 | |
42 | //szv#4:S4163:12Mar99 `st=` not needed |
43 | PR.ReadInteger(PR.Current(),"Number of property values",tempNbPropertyValues); |
44 | PR.ReadText(PR.Current(),"PinNumber",tempPinNumber); |
45 | |
46 | DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); |
47 | ent->Init(tempNbPropertyValues,tempPinNumber); |
48 | } |
49 | |
50 | void IGESAppli_ToolPinNumber::WriteOwnParams |
51 | (const Handle(IGESAppli_PinNumber)& ent, IGESData_IGESWriter& IW) const |
52 | { |
53 | IW.Send(ent->NbPropertyValues()); |
54 | IW.Send(ent->PinNumberVal()); |
55 | } |
56 | |
57 | void IGESAppli_ToolPinNumber::OwnShared |
58 | (const Handle(IGESAppli_PinNumber)& /* ent */, Interface_EntityIterator& /* iter */) const |
59 | { |
60 | } |
61 | |
62 | void IGESAppli_ToolPinNumber::OwnCopy |
63 | (const Handle(IGESAppli_PinNumber)& another, |
64 | const Handle(IGESAppli_PinNumber)& ent, Interface_CopyTool& /* TC */) const |
65 | { |
66 | Standard_Integer aNbPropertyValues; |
67 | Handle(TCollection_HAsciiString) aPinNumber = |
68 | new TCollection_HAsciiString(another->PinNumberVal()); |
69 | aNbPropertyValues = another->NbPropertyValues(); |
70 | ent->Init(aNbPropertyValues,aPinNumber); |
71 | } |
72 | |
73 | Standard_Boolean IGESAppli_ToolPinNumber::OwnCorrect |
74 | (const Handle(IGESAppli_PinNumber)& ent) const |
75 | { |
76 | Standard_Boolean res = (ent->SubordinateStatus() != 0); |
77 | if (res) { |
78 | Handle(IGESData_LevelListEntity) nulevel; |
79 | ent->InitLevel(nulevel,0); |
80 | } |
81 | return res; // RAZ level selon subordibate |
82 | } |
83 | |
84 | IGESData_DirChecker IGESAppli_ToolPinNumber::DirChecker |
85 | (const Handle(IGESAppli_PinNumber)& /* ent */ ) const |
86 | { |
87 | IGESData_DirChecker DC(406,8); //Form no = 8 & Type = 406 |
88 | DC.Structure(IGESData_DefVoid); |
89 | DC.GraphicsIgnored(); |
90 | DC.BlankStatusIgnored(); |
91 | DC.UseFlagIgnored(); |
92 | DC.HierarchyStatusIgnored(); |
93 | return DC; |
94 | } |
95 | |
96 | void IGESAppli_ToolPinNumber::OwnCheck |
97 | (const Handle(IGESAppli_PinNumber)& ent, |
98 | const Interface_ShareTool& , Handle(Interface_Check)& ach) const |
99 | { |
100 | if (ent->SubordinateStatus() != 0) |
101 | if (ent->DefLevel() != IGESData_DefOne && |
102 | ent->DefLevel() != IGESData_DefSeveral) |
103 | ach->AddFail("Level type: Incorrect"); |
104 | if (ent->NbPropertyValues() != 1) |
105 | ach->AddFail("Number of Property Values != 1"); |
106 | //UNFINISHED |
107 | //Level to be ignored if the property is subordinate -- queried |
108 | } |
109 | |
110 | void IGESAppli_ToolPinNumber::OwnDump |
111 | (const Handle(IGESAppli_PinNumber)& ent, const IGESData_IGESDumper& /* dumper */, |
112 | const Handle(Message_Messenger)& S, const Standard_Integer /* level */) const |
113 | { |
114 | S << "IGESAppli_PinNumber" << endl; |
115 | S << "Number of Property Values : " << ent->NbPropertyValues() << endl; |
116 | S << "PinNumber : "; |
117 | IGESData_DumpString(S,ent->PinNumberVal()); |
118 | S << endl; |
119 | } |