summaryrefslogtreecommitdiff
path: root/src/IGESAppli/IGESAppli_ToolPWBDrilledHole.cxx
blob: db3a0e0db3bc307379003f1879b94a904e9d4518 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//--------------------------------------------------------------------
//
//  File Name : IGESAppli_PWBDrilledHole.cxx
//  Date      :
//  Author    : CKY / Contract Toubro-Larsen
//  Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------

#include <IGESAppli_ToolPWBDrilledHole.ixx>
#include <IGESData_ParamCursor.hxx>


IGESAppli_ToolPWBDrilledHole::IGESAppli_ToolPWBDrilledHole ()    {  }


void  IGESAppli_ToolPWBDrilledHole::ReadOwnParams
  (const Handle(IGESAppli_PWBDrilledHole)& ent,
   const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR)  const
{
  //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
  Standard_Integer tempNbPropertyValues;
  Standard_Real tempDrillDiameter;
  Standard_Real tempFinishDiameter;
  Standard_Integer tempFunctionCode;

  //szv#4:S4163:12Mar99 `st=` not needed
  if (PR.DefinedElseSkip())
    PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropertyValues);
  else
    tempNbPropertyValues = 3;

  PR.ReadReal(PR.Current(), "Drill Diameter Size", tempDrillDiameter);
  PR.ReadReal(PR.Current(), "Finish Diameter Size", tempFinishDiameter);
  PR.ReadInteger(PR.Current(), "Drilled Hole Function Code", tempFunctionCode);
  DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
  ent->Init(tempNbPropertyValues, tempDrillDiameter, tempFinishDiameter, tempFunctionCode);
}

void  IGESAppli_ToolPWBDrilledHole::WriteOwnParams
  (const Handle(IGESAppli_PWBDrilledHole)& ent, IGESData_IGESWriter& IW) const
{
  IW.Send(ent->NbPropertyValues());
  IW.Send(ent->DrillDiameterSize());
  IW.Send(ent->FinishDiameterSize());
  IW.Send(ent->FunctionCode());
}

void  IGESAppli_ToolPWBDrilledHole::OwnShared
  (const Handle(IGESAppli_PWBDrilledHole)& /*ent*/, Interface_EntityIterator& /*iter*/) const
{
}

void  IGESAppli_ToolPWBDrilledHole::OwnCopy
  (const Handle(IGESAppli_PWBDrilledHole)& another,
   const Handle(IGESAppli_PWBDrilledHole)& ent, Interface_CopyTool& /*TC*/) const
{
  ent->Init (3,another->DrillDiameterSize(),another->FinishDiameterSize(),
	     another->FunctionCode());
}

Standard_Boolean  IGESAppli_ToolPWBDrilledHole::OwnCorrect
  (const Handle(IGESAppli_PWBDrilledHole)& ent) const
{
  Standard_Boolean res = (ent->NbPropertyValues() != 3);
  if (res) ent->Init
    (3,ent->DrillDiameterSize(),ent->FinishDiameterSize(),ent->FunctionCode());
//     nbpropertyvalues=3
  return res;
}

IGESData_DirChecker  IGESAppli_ToolPWBDrilledHole::DirChecker
  (const Handle(IGESAppli_PWBDrilledHole)& /*ent*/) const
{
  IGESData_DirChecker DC(406, 26);
  DC.Structure(IGESData_DefVoid);
  DC.GraphicsIgnored();
  DC.LineFont(IGESData_DefVoid);
  DC.LineWeight(IGESData_DefVoid);
  DC.Color(IGESData_DefVoid);
  DC.BlankStatusIgnored();
  DC.UseFlagIgnored();
  DC.HierarchyStatusIgnored();
  return DC;
}

void  IGESAppli_ToolPWBDrilledHole::OwnCheck
  (const Handle(IGESAppli_PWBDrilledHole)& ent,
   const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
  if (ent->NbPropertyValues() != 3)
    ach->AddFail("Number of property values != 3");
  if ( (ent->FunctionCode() < 1) ||
      ((ent->FunctionCode() > 5) && (ent->FunctionCode() < 5001)) ||
      (ent->FunctionCode() > 9999))
    ach->AddFail("Drilled Hole Function Code != 1-5,5001-9999");
}

void  IGESAppli_ToolPWBDrilledHole::OwnDump
  (const Handle(IGESAppli_PWBDrilledHole)& ent, const IGESData_IGESDumper& /*dumper*/,
   const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
{
  S << "IGESAppli_PWBDrilledHole" << endl;
  S << "Number of property values : " << ent->NbPropertyValues() << endl;
  S << "Drill Diameter Size  : " << ent->DrillDiameterSize() << endl;
  S << "Finish Diameter Size : " << ent->FinishDiameterSize() << endl;
  S << "Drilled Hole Function Code : " << ent->FunctionCode() << endl;
}