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 <IGESData_DirChecker.hxx>
20 #include <IGESData_IGESDumper.hxx>
21 #include <IGESData_IGESReaderData.hxx>
22 #include <IGESData_IGESWriter.hxx>
23 #include <IGESData_ParamReader.hxx>
24 #include <IGESGraph_LineFontPredefined.hxx>
25 #include <IGESGraph_ToolLineFontPredefined.hxx>
26 #include <Interface_Check.hxx>
27 #include <Interface_CopyTool.hxx>
28 #include <Interface_EntityIterator.hxx>
29 #include <Interface_ShareTool.hxx>
31 IGESGraph_ToolLineFontPredefined::IGESGraph_ToolLineFontPredefined () { }
34 void IGESGraph_ToolLineFontPredefined::ReadOwnParams
35 (const Handle(IGESGraph_LineFontPredefined)& ent,
36 const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
38 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
40 Standard_Integer nbPropertyValues;
41 Standard_Integer lineFontPatternCode;
43 // Reading nbPropertyValues(Integer)
44 PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed
45 if (nbPropertyValues != 1)
46 PR.AddFail("No. of Property values : Value is not 1");
48 // Reading lineFontPatternCode(Integer)
49 PR.ReadInteger(PR.Current(), "Line Font Pattern Code", lineFontPatternCode); //szv#4:S4163:12Mar99 `st=` not needed
51 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
52 ent->Init(nbPropertyValues, lineFontPatternCode);
55 void IGESGraph_ToolLineFontPredefined::WriteOwnParams
56 (const Handle(IGESGraph_LineFontPredefined)& ent, IGESData_IGESWriter& IW) const
58 IW.Send( ent->NbPropertyValues() );
59 IW.Send( ent->LineFontPatternCode() );
62 void IGESGraph_ToolLineFontPredefined::OwnShared
63 (const Handle(IGESGraph_LineFontPredefined)& /*ent*/, Interface_EntityIterator& /*iter*/) const
67 void IGESGraph_ToolLineFontPredefined::OwnCopy
68 (const Handle(IGESGraph_LineFontPredefined)& another,
69 const Handle(IGESGraph_LineFontPredefined)& ent, Interface_CopyTool& /*TC*/) const
71 ent->Init(1,another->LineFontPatternCode());
74 Standard_Boolean IGESGraph_ToolLineFontPredefined::OwnCorrect
75 (const Handle(IGESGraph_LineFontPredefined)& ent) const
77 Standard_Boolean res = (ent->NbPropertyValues() != 1);
78 if (res) ent->Init(1,ent->LineFontPatternCode()); // nbpropertyvalues=1
82 IGESData_DirChecker IGESGraph_ToolLineFontPredefined::DirChecker
83 (const Handle(IGESGraph_LineFontPredefined)& /*ent*/) const
85 IGESData_DirChecker DC (406, 19);
86 DC.Structure(IGESData_DefVoid);
87 DC.LineFont(IGESData_DefVoid);
88 DC.LineWeight(IGESData_DefVoid);
89 DC.Color(IGESData_DefVoid);
90 DC.BlankStatusIgnored();
92 DC.HierarchyStatusIgnored();
96 void IGESGraph_ToolLineFontPredefined::OwnCheck
97 (const Handle(IGESGraph_LineFontPredefined)& ent,
98 const Interface_ShareTool& , Handle(Interface_Check)& ach) const
100 if (ent->NbPropertyValues() != 1)
101 ach->AddFail("No. of Property values : Value != 1");
104 void IGESGraph_ToolLineFontPredefined::OwnDump
105 (const Handle(IGESGraph_LineFontPredefined)& ent, const IGESData_IGESDumper& /*dumper*/,
106 Standard_OStream& S, const Standard_Integer /*level*/) const
108 S << "IGESGraph_LineFontPredefined\n"
109 << "No. of property values : " << ent->NbPropertyValues() << "\n"
110 << "Line font pattern code : " << ent->LineFontPatternCode() << "\n"