1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
20 //--------------------------------------------------------------------
21 //--------------------------------------------------------------------
23 #include <IGESAppli_ToolDrilledHole.ixx>
24 #include <IGESData_ParamCursor.hxx>
25 #include <IGESData_LevelListEntity.hxx>
28 IGESAppli_ToolDrilledHole::IGESAppli_ToolDrilledHole () { }
31 void IGESAppli_ToolDrilledHole::ReadOwnParams
32 (const Handle(IGESAppli_DrilledHole)& ent,
33 const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
35 Standard_Integer tempNbPropertyValues;
36 Standard_Real tempDrillDiaSize;
37 Standard_Real tempFinishDiaSize;
38 Standard_Integer tempPlatingFlag;
39 Standard_Integer tempNbLowerLayer;
40 Standard_Integer tempNbHigherLayer;
41 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
43 //szv#4:S4163:12Mar99 `st=` not needed
44 PR.ReadInteger(PR.Current(),"No. of Property values",tempNbPropertyValues);
45 PR.ReadReal(PR.Current(),"Drill diameter size",tempDrillDiaSize);
46 PR.ReadReal(PR.Current(),"Finish diameter size",tempFinishDiaSize);
47 PR.ReadInteger(PR.Current(),"Plating Flag",tempPlatingFlag);
48 PR.ReadInteger(PR.Current(),"Lower numbered layer", tempNbLowerLayer);
49 PR.ReadInteger(PR.Current(),"Higher numbered layer", tempNbHigherLayer);
51 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
52 ent->Init(tempNbPropertyValues,tempDrillDiaSize,tempFinishDiaSize,
53 tempPlatingFlag, tempNbLowerLayer,tempNbHigherLayer);
56 void IGESAppli_ToolDrilledHole::WriteOwnParams
57 (const Handle(IGESAppli_DrilledHole)& ent, IGESData_IGESWriter& IW) const
59 IW.Send(ent->NbPropertyValues());
60 IW.Send(ent->DrillDiaSize());
61 IW.Send(ent->FinishDiaSize());
62 IW.SendBoolean(ent->IsPlating());
63 IW.Send(ent->NbLowerLayer());
64 IW.Send(ent->NbHigherLayer());
67 void IGESAppli_ToolDrilledHole::OwnShared
68 (const Handle(IGESAppli_DrilledHole)& /*ent*/, Interface_EntityIterator& /*iter*/) const
72 void IGESAppli_ToolDrilledHole::OwnCopy
73 (const Handle(IGESAppli_DrilledHole)& another,
74 const Handle(IGESAppli_DrilledHole)& ent, Interface_CopyTool& /*TC*/) const
77 (5,another->DrillDiaSize(),another->FinishDiaSize(),
78 (another->IsPlating() ? 1 : 0),
79 another->NbLowerLayer(),another->NbHigherLayer());
83 Standard_Boolean IGESAppli_ToolDrilledHole::OwnCorrect
84 (const Handle(IGESAppli_DrilledHole)& ent) const
86 Standard_Boolean res = (ent->NbPropertyValues() != 5);
88 (5,ent->DrillDiaSize(),ent->FinishDiaSize(),(ent->IsPlating() ? 1 : 0),
89 ent->NbLowerLayer(),ent->NbHigherLayer());
90 if (ent->SubordinateStatus() != 0) {
91 Handle(IGESData_LevelListEntity) nulevel;
92 ent->InitLevel(nulevel,0);
94 } // NbPropertyvalues = 5 + RAZ level selon subordinate
98 IGESData_DirChecker IGESAppli_ToolDrilledHole::DirChecker
99 (const Handle(IGESAppli_DrilledHole)& /*ent*/) const
101 IGESData_DirChecker DC(406,6); //Form no = 6 & Type = 406
102 DC.Structure(IGESData_DefVoid);
103 DC.GraphicsIgnored();
104 DC.BlankStatusIgnored();
106 DC.HierarchyStatusIgnored();
110 void IGESAppli_ToolDrilledHole::OwnCheck
111 (const Handle(IGESAppli_DrilledHole)& ent,
112 const Interface_ShareTool& , Handle(Interface_Check)& ach) const
114 if (ent->SubordinateStatus() != 0)
115 if (ent->DefLevel() != IGESData_DefOne &&
116 ent->DefLevel() != IGESData_DefSeveral)
117 ach->AddFail("Level type : Not value/reference");
118 if (ent->NbPropertyValues() != 5)
119 ach->AddFail("Number of Property Values != 5");
122 void IGESAppli_ToolDrilledHole::OwnDump
123 (const Handle(IGESAppli_DrilledHole)& ent, const IGESData_IGESDumper& /*dumper*/,
124 const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
126 S << "IGESAppli_DrilledHole" << endl;
128 S << "Number of property values : " << ent->NbPropertyValues() << endl;
129 S << "Drill diameter size :" << ent->DrillDiaSize() << " ";
130 S << "Finish diameter size : " << ent->FinishDiaSize() << endl;
131 S << "Plating indication flag : ";
132 if (!ent->IsPlating()) S << "NO" << " - ";
133 else S << "YES" << " - ";
134 S << "Lower Numbered Layer : " << ent->NbLowerLayer() << " ";
135 S << "Higher Numbered Layer : " << ent->NbHigherLayer() << endl;