0030895: Coding Rules - specify std namespace explicitly for std::cout and streams
[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_ParamCursor.hxx>
24 #include <IGESData_ParamReader.hxx>
25 #include <IGESGraph_LineFontPredefined.hxx>
26 #include <IGESGraph_ToolLineFontPredefined.hxx>
27 #include <Interface_Check.hxx>
28 #include <Interface_CopyTool.hxx>
29 #include <Interface_EntityIterator.hxx>
30 #include <Interface_ShareTool.hxx>
31 #include <Message_Messenger.hxx>
32 #include <Standard_DomainError.hxx>
33
34 IGESGraph_ToolLineFontPredefined::IGESGraph_ToolLineFontPredefined ()    {  }
35
36
37 void IGESGraph_ToolLineFontPredefined::ReadOwnParams
38   (const Handle(IGESGraph_LineFontPredefined)& ent,
39    const Handle(IGESData_IGESReaderData)& /*IR*/, IGESData_ParamReader& PR) const
40
41   //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
42
43   Standard_Integer nbPropertyValues;
44   Standard_Integer lineFontPatternCode;
45
46   // Reading nbPropertyValues(Integer)
47   PR.ReadInteger(PR.Current(), "No. of property values", nbPropertyValues); //szv#4:S4163:12Mar99 `st=` not needed
48   if (nbPropertyValues != 1)
49     PR.AddFail("No. of Property values : Value is not 1");
50
51   // Reading lineFontPatternCode(Integer)
52   PR.ReadInteger(PR.Current(), "Line Font Pattern Code", lineFontPatternCode); //szv#4:S4163:12Mar99 `st=` not needed
53
54   DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
55   ent->Init(nbPropertyValues, lineFontPatternCode);
56 }
57
58 void IGESGraph_ToolLineFontPredefined::WriteOwnParams
59   (const Handle(IGESGraph_LineFontPredefined)& ent, IGESData_IGESWriter& IW)  const
60
61   IW.Send( ent->NbPropertyValues() );
62   IW.Send( ent->LineFontPatternCode() );
63 }
64
65 void  IGESGraph_ToolLineFontPredefined::OwnShared
66   (const Handle(IGESGraph_LineFontPredefined)& /*ent*/, Interface_EntityIterator& /*iter*/) const
67 {
68 }
69
70 void IGESGraph_ToolLineFontPredefined::OwnCopy
71   (const Handle(IGESGraph_LineFontPredefined)& another,
72    const Handle(IGESGraph_LineFontPredefined)& ent, Interface_CopyTool& /*TC*/) const
73 {
74   ent->Init(1,another->LineFontPatternCode());
75 }
76
77 Standard_Boolean  IGESGraph_ToolLineFontPredefined::OwnCorrect
78   (const Handle(IGESGraph_LineFontPredefined)& ent) const
79 {
80   Standard_Boolean res = (ent->NbPropertyValues() != 1);
81   if (res) ent->Init(1,ent->LineFontPatternCode());    // nbpropertyvalues=1
82   return res;
83 }
84
85 IGESData_DirChecker IGESGraph_ToolLineFontPredefined::DirChecker
86   (const Handle(IGESGraph_LineFontPredefined)& /*ent*/)  const
87
88   IGESData_DirChecker DC (406, 19);
89   DC.Structure(IGESData_DefVoid);
90   DC.LineFont(IGESData_DefVoid);
91   DC.LineWeight(IGESData_DefVoid);
92   DC.Color(IGESData_DefVoid);
93   DC.BlankStatusIgnored();
94   DC.UseFlagIgnored();
95   DC.HierarchyStatusIgnored();
96   return DC;
97 }
98
99 void IGESGraph_ToolLineFontPredefined::OwnCheck
100   (const Handle(IGESGraph_LineFontPredefined)& ent,
101    const Interface_ShareTool& , Handle(Interface_Check)& ach)  const
102 {
103   if (ent->NbPropertyValues() != 1)
104     ach->AddFail("No. of Property values : Value != 1");
105 }
106
107 void IGESGraph_ToolLineFontPredefined::OwnDump
108   (const Handle(IGESGraph_LineFontPredefined)& ent, const IGESData_IGESDumper& /*dumper*/,
109    const Handle(Message_Messenger)& S, const Standard_Integer /*level*/)  const
110 {
111   S << "IGESGraph_LineFontPredefined" << Message_EndLine;
112
113   S << "No. of property values : " << ent->NbPropertyValues() << Message_EndLine;
114   S << "Line font pattern code : " << ent->LineFontPatternCode() << Message_EndLine;
115   S << Message_EndLine;
116 }