0022627: Change OCCT memory management defaults
[occt.git] / src / IGESAppli / IGESAppli_ToolLevelFunction.cxx
CommitLineData
7fd59977 1//--------------------------------------------------------------------
2//
3// File Name : IGESAppli_LevelFunction.cxx
4// Date :
5// Author : CKY / Contract Toubro-Larsen
6// Copyright : MATRA-DATAVISION 1993
7//
8//--------------------------------------------------------------------
9
10#include <IGESAppli_ToolLevelFunction.ixx>
11#include <IGESData_ParamCursor.hxx>
12#include <TCollection_HAsciiString.hxx>
13#include <Interface_Macros.hxx>
14#include <IGESData_Dump.hxx>
15
16
17IGESAppli_ToolLevelFunction::IGESAppli_ToolLevelFunction () { }
18
19
20void IGESAppli_ToolLevelFunction::ReadOwnParams
21 (const Handle(IGESAppli_LevelFunction)& ent,
22 const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
23{
24 Standard_Integer tempNbPropertyValues;
25 Standard_Integer tempFuncDescripCode;
26 Handle(TCollection_HAsciiString) tempFuncDescrip;
27 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
28
29 //szv#4:S4163:12Mar99 `st=` not needed
30 PR.ReadInteger(PR.Current(),"No. of Property values", tempNbPropertyValues);
31
32 if (PR.DefinedElseSkip())
33 PR.ReadInteger(PR.Current(),"Function description code",tempFuncDescripCode);
34 else
35 tempFuncDescripCode = 0;
36
37 if (PR.DefinedElseSkip())
38 PR.ReadText(PR.Current(),"Function description",tempFuncDescrip);
39
40 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
41 ent->Init (tempNbPropertyValues,tempFuncDescripCode,tempFuncDescrip);
42}
43
44void IGESAppli_ToolLevelFunction::WriteOwnParams
45 (const Handle(IGESAppli_LevelFunction)& ent, IGESData_IGESWriter& IW) const
46{
47 IW.Send(ent->NbPropertyValues());
48 IW.Send(ent->FuncDescriptionCode());
49 if (ent->FuncDescription().IsNull()) IW.SendVoid();
50 else IW.Send(ent->FuncDescription());
51}
52
53void IGESAppli_ToolLevelFunction::OwnShared
54 (const Handle(IGESAppli_LevelFunction)& /* ent */, Interface_EntityIterator& /* iter */) const
55{
56}
57
58void IGESAppli_ToolLevelFunction::OwnCopy
59 (const Handle(IGESAppli_LevelFunction)& another,
60 const Handle(IGESAppli_LevelFunction)& ent, Interface_CopyTool& /* TC */) const
61{
62 Standard_Integer aNbPropertyValues, code;
63 Handle(TCollection_HAsciiString) descrip;
64 if (!another->FuncDescription().IsNull()) descrip =
65 new TCollection_HAsciiString(another->FuncDescription());
66 code = another->FuncDescriptionCode();
67 aNbPropertyValues = another->NbPropertyValues();
68
69 ent->Init(aNbPropertyValues,code,descrip);
70}
71
72Standard_Boolean IGESAppli_ToolLevelFunction::OwnCorrect
73 (const Handle(IGESAppli_LevelFunction)& ent) const
74{
75 Standard_Boolean res = (ent->NbPropertyValues() != 2);
76 if (res) ent->Init(2,ent->FuncDescriptionCode(),ent->FuncDescription());
77 return res; // nbpropertyvalues = 2
78}
79
80IGESData_DirChecker IGESAppli_ToolLevelFunction::DirChecker
81 (const Handle(IGESAppli_LevelFunction)& /* ent */ ) const
82{
83 IGESData_DirChecker DC(406,3); //Form no = 3 & Type = 406
84 DC.Structure(IGESData_DefVoid);
85 DC.GraphicsIgnored();
86 DC.BlankStatusIgnored();
87 DC.UseFlagIgnored();
88 DC.HierarchyStatusIgnored();
89 DC.SubordinateStatusRequired(00);
90 return DC;
91}
92
93void IGESAppli_ToolLevelFunction::OwnCheck
94 (const Handle(IGESAppli_LevelFunction)& ent,
95 const Interface_ShareTool& , Handle(Interface_Check)& ach) const
96{
97 if (ent->NbPropertyValues() != 2)
98 ach->AddFail("Number of Property Values != 2");
99}
100
101void IGESAppli_ToolLevelFunction::OwnDump
102 (const Handle(IGESAppli_LevelFunction)& ent, const IGESData_IGESDumper& /* dumper */,
103 const Handle(Message_Messenger)& S, const Standard_Integer /* level */) const
104{
105 S << "IGESAppli_LevelFunction" << endl;
106
107 S << "Number of property values : " << ent->NbPropertyValues() << endl;
108 S << "Function Description code : " << ent->FuncDescriptionCode() << endl;
109 S << "Function Description : ";
110 IGESData_DumpString(S,ent->FuncDescription());
111 S << endl;
112}