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