1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
19 #include <IGESBasic_ToolHierarchy.ixx>
20 #include <IGESData_ParamCursor.hxx>
23 IGESBasic_ToolHierarchy::IGESBasic_ToolHierarchy () { }
26 void IGESBasic_ToolHierarchy::ReadOwnParams
27 (const Handle(IGESBasic_Hierarchy)& ent,
28 const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
30 Standard_Integer tempNbPropertyValues;
31 Standard_Integer tempLineFont;
32 Standard_Integer tempView;
33 Standard_Integer tempEntityLevel;
34 Standard_Integer tempBlankStatus;
35 Standard_Integer tempLineWeight;
36 Standard_Integer tempColorNum;
37 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
39 //szv#4:S4163:12Mar99 `st=` not needed
40 PR.ReadInteger(PR.Current(),"No. of Property values",tempNbPropertyValues);
41 PR.ReadInteger(PR.Current(),"LineFont",tempLineFont);
42 PR.ReadInteger(PR.Current(),"View",tempView);
43 PR.ReadInteger(PR.Current(),"Entity level",tempEntityLevel);
44 PR.ReadInteger(PR.Current(),"Blank status",tempBlankStatus);
45 PR.ReadInteger(PR.Current(),"Line weight",tempLineWeight);
46 PR.ReadInteger(PR.Current(),"Color number",tempColorNum);
48 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
49 ent->Init(tempNbPropertyValues,tempLineFont,tempView,tempEntityLevel,
50 tempBlankStatus,tempLineWeight,tempColorNum);
53 void IGESBasic_ToolHierarchy::WriteOwnParams
54 (const Handle(IGESBasic_Hierarchy)& ent, IGESData_IGESWriter& IW) const
56 IW.Send(ent->NbPropertyValues());
57 IW.Send(ent->NewLineFont());
58 IW.Send(ent->NewView());
59 IW.Send(ent->NewEntityLevel());
60 IW.Send(ent->NewBlankStatus());
61 IW.Send(ent->NewLineWeight());
62 IW.Send(ent->NewColorNum());
65 void IGESBasic_ToolHierarchy::OwnShared
66 (const Handle(IGESBasic_Hierarchy)& /*ent*/, Interface_EntityIterator& /*iter*/) const
70 void IGESBasic_ToolHierarchy::OwnCopy
71 (const Handle(IGESBasic_Hierarchy)& another,
72 const Handle(IGESBasic_Hierarchy)& ent, Interface_CopyTool& /*TC*/) const
74 ent->Init(6,another->NewLineFont(), another->NewView(),
75 another->NewEntityLevel(),another->NewBlankStatus(),
76 another->NewLineWeight(), another->NewColorNum());
79 Standard_Boolean IGESBasic_ToolHierarchy::OwnCorrect
80 (const Handle(IGESBasic_Hierarchy)& ent) const
82 Standard_Boolean res = (ent->NbPropertyValues() != 6);
84 (6,ent->NewLineFont(),ent->NewView(),ent->NewEntityLevel(),
85 ent->NewBlankStatus(),ent->NewLineWeight(),ent->NewColorNum());
86 return res; // nbpropertyvalues=6
89 IGESData_DirChecker IGESBasic_ToolHierarchy::DirChecker
90 (const Handle(IGESBasic_Hierarchy)& /*ent*/) const
92 IGESData_DirChecker DC(406,10); //Form no = 10 & Type = 406
93 DC.Structure(IGESData_DefVoid);
95 DC.BlankStatusIgnored();
97 DC.HierarchyStatusIgnored();
101 void IGESBasic_ToolHierarchy::OwnCheck
102 (const Handle(IGESBasic_Hierarchy)& ent,
103 const Interface_ShareTool& , Handle(Interface_Check)& ach) const
105 if (ent->NbPropertyValues() != 6)
106 ach->AddFail("Number of Property Values != 6");
107 if (ent->NewLineFont() != 0 && ent->NewLineFont() != 1)
108 ach->AddFail("InCorrect LineFont");
109 if (ent->NewView() != 0 && ent->NewView() != 1)
110 ach->AddFail("InCorrect View");
111 if (ent->NewEntityLevel() != 0 && ent->NewEntityLevel() != 1)
112 ach->AddFail("InCorrect EntityLevel");
113 if (ent->NewBlankStatus() != 0 && ent->NewBlankStatus() != 1)
114 if (ent->NewLineWeight() != 0 && ent->NewLineWeight() != 1)
115 ach->AddFail("InCorrect LineWeight");
116 if (ent->NewColorNum() != 0 && ent->NewColorNum() != 1)
117 ach->AddFail("InCorrect ColorNum");
120 void IGESBasic_ToolHierarchy::OwnDump
121 (const Handle(IGESBasic_Hierarchy)& ent, const IGESData_IGESDumper& /*dumper*/,
122 const Handle(Message_Messenger)& S, const Standard_Integer /*level*/) const
124 S << "IGESBasic_Hierarchy" << endl;
126 S << "Number of property values : " << ent->NbPropertyValues() << endl;
127 S << "Line Font : " << ent->NewLineFont() << endl;
128 S << "View Number : " << ent->NewView() << endl;
129 S << "Entity level : " << ent->NewEntityLevel() << endl;
130 S << "Blank status : " << ent->NewBlankStatus() << endl;
131 S << "Line weight : " << ent->NewLineWeight() << endl;
132 S << "Color number : " << ent->NewColorNum() << endl;