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_ToolPWBDrilledHole.ixx> |
24 | #include <IGESData_ParamCursor.hxx> |
25 | |
26 | |
27 | IGESAppli_ToolPWBDrilledHole::IGESAppli_ToolPWBDrilledHole () { } |
28 | |
29 | |
30 | void IGESAppli_ToolPWBDrilledHole::ReadOwnParams |
31 | (const Handle(IGESAppli_PWBDrilledHole)& ent, |
32 | const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const |
33 | { |
34 | //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed |
35 | Standard_Integer tempNbPropertyValues; |
36 | Standard_Real tempDrillDiameter; |
37 | Standard_Real tempFinishDiameter; |
38 | Standard_Integer tempFunctionCode; |
39 | |
40 | //szv#4:S4163:12Mar99 `st=` not needed |
41 | if (PR.DefinedElseSkip()) |
42 | PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropertyValues); |
43 | else |
44 | tempNbPropertyValues = 3; |
45 | |
46 | PR.ReadReal(PR.Current(), "Drill Diameter Size", tempDrillDiameter); |
47 | PR.ReadReal(PR.Current(), "Finish Diameter Size", tempFinishDiameter); |
48 | PR.ReadInteger(PR.Current(), "Drilled Hole Function Code", tempFunctionCode); |
49 | DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent); |
50 | ent->Init(tempNbPropertyValues, tempDrillDiameter, tempFinishDiameter, tempFunctionCode); |
51 | } |
52 | |
53 | void IGESAppli_ToolPWBDrilledHole::WriteOwnParams |
54 | (const Handle(IGESAppli_PWBDrilledHole)& ent, IGESData_IGESWriter& IW) const |
55 | { |
56 | IW.Send(ent->NbPropertyValues()); |
57 | IW.Send(ent->DrillDiameterSize()); |
58 | IW.Send(ent->FinishDiameterSize()); |
59 | IW.Send(ent->FunctionCode()); |
60 | } |
61 | |
62 | void IGESAppli_ToolPWBDrilledHole::OwnShared |
63 | (const Handle(IGESAppli_PWBDrilledHole)& /*ent*/, Interface_EntityIterator& /*iter*/) const |
64 | { |
65 | } |
66 | |
67 | void IGESAppli_ToolPWBDrilledHole::OwnCopy |
68 | (const Handle(IGESAppli_PWBDrilledHole)& another, |
69 | const Handle(IGESAppli_PWBDrilledHole)& ent, Interface_CopyTool& /*TC*/) const |
70 | { |
71 | ent->Init (3,another->DrillDiameterSize(),another->FinishDiameterSize(), |
72 | another->FunctionCode()); |
73 | } |
74 | |
75 | Standard_Boolean IGESAppli_ToolPWBDrilledHole::OwnCorrect |
76 | (const Handle(IGESAppli_PWBDrilledHole)& ent) const |
77 | { |
78 | Standard_Boolean res = (ent->NbPropertyValues() != 3); |
79 | if (res) ent->Init |
80 | (3,ent->DrillDiameterSize(),ent->FinishDiameterSize(),ent->FunctionCode()); |
81 | // nbpropertyvalues=3 |
82 | return res; |
83 | } |
84 | |
85 | IGESData_DirChecker IGESAppli_ToolPWBDrilledHole::DirChecker |
86 | (const Handle(IGESAppli_PWBDrilledHole)& /*ent*/) const |
87 | { |
88 | IGESData_DirChecker DC(406, 26); |
89 | DC.Structure(IGESData_DefVoid); |
90 | DC.GraphicsIgnored(); |
91 | DC.LineFont(IGESData_DefVoid); |
92 | DC.LineWeight(IGESData_DefVoid); |
93 | DC.Color(IGESData_DefVoid); |
94 | DC.BlankStatusIgnored(); |
95 | DC.UseFlagIgnored(); |
96 | DC.HierarchyStatusIgnored(); |
97 | return DC; |
98 | } |
99 | |
100 | void IGESAppli_ToolPWBDrilledHole::OwnCheck |
101 | (const Handle(IGESAppli_PWBDrilledHole)& ent, |
102 | const Interface_ShareTool& , Handle(Interface_Check)& ach) const |
103 | { |
104 | if (ent->NbPropertyValues() != 3) |
105 | ach->AddFail("Number of property values != 3"); |
106 | if ( (ent->FunctionCode() < 1) || |
107 | ((ent->FunctionCode() > 5) && (ent->FunctionCode() < 5001)) || |
108 | (ent->FunctionCode() > 9999)) |
109 | ach->AddFail("Drilled Hole Function Code != 1-5,5001-9999"); |
110 | } |
111 | |
112 | void IGESAppli_ToolPWBDrilledHole::OwnDump |
113 | (const Handle(IGESAppli_PWBDrilledHole)& ent, const IGESData_IGESDumper& /*dumper*/, |
114 | const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const |
115 | { |
116 | S << "IGESAppli_PWBDrilledHole" << endl; |
117 | S << "Number of property values : " << ent->NbPropertyValues() << endl; |
118 | S << "Drill Diameter Size : " << ent->DrillDiameterSize() << endl; |
119 | S << "Finish Diameter Size : " << ent->FinishDiameterSize() << endl; |
120 | S << "Drilled Hole Function Code : " << ent->FunctionCode() << endl; |
121 | } |