0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / IGESGraph / IGESGraph_ToolLineFontPredefined.cxx
1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
18
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>
30
31 IGESGraph_ToolLineFontPredefined::IGESGraph_ToolLineFontPredefined ()    {  }
32
33
34 void IGESGraph_ToolLineFontPredefined::ReadOwnParams
35   (const Handle(IGESGraph_LineFontPredefined)& ent,
36    const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
37
38   //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
39
40   Standard_Integer nbPropertyValues;
41   Standard_Integer lineFontPatternCode;
42
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");
47
48   // Reading lineFontPatternCode(Integer)
49   PR.ReadInteger(PR.Current(), "Line Font Pattern Code", lineFontPatternCode); //szv#4:S4163:12Mar99 `st=` not needed
50
51   DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
52   ent->Init(nbPropertyValues, lineFontPatternCode);
53 }
54
55 void IGESGraph_ToolLineFontPredefined::WriteOwnParams
56   (const Handle(IGESGraph_LineFontPredefined)& ent, IGESData_IGESWriter& IW)  const
57
58   IW.Send( ent->NbPropertyValues() );
59   IW.Send( ent->LineFontPatternCode() );
60 }
61
62 void  IGESGraph_ToolLineFontPredefined::OwnShared
63   (const Handle(IGESGraph_LineFontPredefined)& /*ent*/, Interface_EntityIterator& /*iter*/) const
64 {
65 }
66
67 void IGESGraph_ToolLineFontPredefined::OwnCopy
68   (const Handle(IGESGraph_LineFontPredefined)& another,
69    const Handle(IGESGraph_LineFontPredefined)& ent, Interface_CopyTool& /*TC*/) const
70 {
71   ent->Init(1,another->LineFontPatternCode());
72 }
73
74 Standard_Boolean  IGESGraph_ToolLineFontPredefined::OwnCorrect
75   (const Handle(IGESGraph_LineFontPredefined)& ent) const
76 {
77   Standard_Boolean res = (ent->NbPropertyValues() != 1);
78   if (res) ent->Init(1,ent->LineFontPatternCode());    // nbpropertyvalues=1
79   return res;
80 }
81
82 IGESData_DirChecker IGESGraph_ToolLineFontPredefined::DirChecker
83   (const Handle(IGESGraph_LineFontPredefined)& /*ent*/)  const
84
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();
91   DC.UseFlagIgnored();
92   DC.HierarchyStatusIgnored();
93   return DC;
94 }
95
96 void IGESGraph_ToolLineFontPredefined::OwnCheck
97   (const Handle(IGESGraph_LineFontPredefined)& ent,
98    const Interface_ShareTool& , Handle(Interface_Check)& ach)  const
99 {
100   if (ent->NbPropertyValues() != 1)
101     ach->AddFail("No. of Property values : Value != 1");
102 }
103
104 void IGESGraph_ToolLineFontPredefined::OwnDump
105   (const Handle(IGESGraph_LineFontPredefined)& ent, const IGESData_IGESDumper& /*dumper*/,
106    Standard_OStream& S, const Standard_Integer /*level*/)  const
107 {
108   S << "IGESGraph_LineFontPredefined\n"
109     << "No. of property values : " << ent->NbPropertyValues() << "\n"
110     << "Line font pattern code : " << ent->LineFontPatternCode() << "\n"
111     << std::endl;
112 }