0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / IGESAppli / IGESAppli_ToolLevelFunction.cxx
CommitLineData
b311480e 1// Created by: CKY / Contract Toubro-Larsen
2// Copyright (c) 1993-1999 Matra Datavision
3// Copyright (c) 1999-2012 OPEN CASCADE SAS
4//
5// The content of this file is subject to the Open CASCADE Technology Public
6// License Version 6.5 (the "License"). You may not use the content of this file
7// except in compliance with the License. Please obtain a copy of the License
8// at http://www.opencascade.org and read it completely before using this file.
7fd59977 9//
b311480e 10// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
7fd59977 12//
b311480e 13// The Original Code and all software distributed under the License is
14// distributed on an "AS IS" basis, without warranty of any kind, and the
15// Initial Developer hereby disclaims all such warranties, including without
16// limitation, any warranties of merchantability, fitness for a particular
17// purpose or non-infringement. Please see the License for the specific terms
18// and conditions governing the rights and limitations under the License.
19
20//--------------------------------------------------------------------
7fd59977 21//--------------------------------------------------------------------
22
23#include <IGESAppli_ToolLevelFunction.ixx>
24#include <IGESData_ParamCursor.hxx>
25#include <TCollection_HAsciiString.hxx>
26#include <Interface_Macros.hxx>
27#include <IGESData_Dump.hxx>
28
29
30IGESAppli_ToolLevelFunction::IGESAppli_ToolLevelFunction () { }
31
32
33void IGESAppli_ToolLevelFunction::ReadOwnParams
34 (const Handle(IGESAppli_LevelFunction)& ent,
35 const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
36{
37 Standard_Integer tempNbPropertyValues;
38 Standard_Integer tempFuncDescripCode;
39 Handle(TCollection_HAsciiString) tempFuncDescrip;
40 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
41
42 //szv#4:S4163:12Mar99 `st=` not needed
43 PR.ReadInteger(PR.Current(),"No. of Property values", tempNbPropertyValues);
44
45 if (PR.DefinedElseSkip())
46 PR.ReadInteger(PR.Current(),"Function description code",tempFuncDescripCode);
47 else
48 tempFuncDescripCode = 0;
49
50 if (PR.DefinedElseSkip())
51 PR.ReadText(PR.Current(),"Function description",tempFuncDescrip);
52
53 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
54 ent->Init (tempNbPropertyValues,tempFuncDescripCode,tempFuncDescrip);
55}
56
57void IGESAppli_ToolLevelFunction::WriteOwnParams
58 (const Handle(IGESAppli_LevelFunction)& ent, IGESData_IGESWriter& IW) const
59{
60 IW.Send(ent->NbPropertyValues());
61 IW.Send(ent->FuncDescriptionCode());
62 if (ent->FuncDescription().IsNull()) IW.SendVoid();
63 else IW.Send(ent->FuncDescription());
64}
65
66void IGESAppli_ToolLevelFunction::OwnShared
67 (const Handle(IGESAppli_LevelFunction)& /* ent */, Interface_EntityIterator& /* iter */) const
68{
69}
70
71void IGESAppli_ToolLevelFunction::OwnCopy
72 (const Handle(IGESAppli_LevelFunction)& another,
73 const Handle(IGESAppli_LevelFunction)& ent, Interface_CopyTool& /* TC */) const
74{
75 Standard_Integer aNbPropertyValues, code;
76 Handle(TCollection_HAsciiString) descrip;
77 if (!another->FuncDescription().IsNull()) descrip =
78 new TCollection_HAsciiString(another->FuncDescription());
79 code = another->FuncDescriptionCode();
80 aNbPropertyValues = another->NbPropertyValues();
81
82 ent->Init(aNbPropertyValues,code,descrip);
83}
84
85Standard_Boolean IGESAppli_ToolLevelFunction::OwnCorrect
86 (const Handle(IGESAppli_LevelFunction)& ent) const
87{
88 Standard_Boolean res = (ent->NbPropertyValues() != 2);
89 if (res) ent->Init(2,ent->FuncDescriptionCode(),ent->FuncDescription());
90 return res; // nbpropertyvalues = 2
91}
92
93IGESData_DirChecker IGESAppli_ToolLevelFunction::DirChecker
94 (const Handle(IGESAppli_LevelFunction)& /* ent */ ) const
95{
96 IGESData_DirChecker DC(406,3); //Form no = 3 & Type = 406
97 DC.Structure(IGESData_DefVoid);
98 DC.GraphicsIgnored();
99 DC.BlankStatusIgnored();
100 DC.UseFlagIgnored();
101 DC.HierarchyStatusIgnored();
102 DC.SubordinateStatusRequired(00);
103 return DC;
104}
105
106void IGESAppli_ToolLevelFunction::OwnCheck
107 (const Handle(IGESAppli_LevelFunction)& ent,
108 const Interface_ShareTool& , Handle(Interface_Check)& ach) const
109{
110 if (ent->NbPropertyValues() != 2)
111 ach->AddFail("Number of Property Values != 2");
112}
113
114void IGESAppli_ToolLevelFunction::OwnDump
115 (const Handle(IGESAppli_LevelFunction)& ent, const IGESData_IGESDumper& /* dumper */,
116 const Handle(Message_Messenger)& S, const Standard_Integer /* level */) const
117{
118 S << "IGESAppli_LevelFunction" << endl;
119
120 S << "Number of property values : " << ent->NbPropertyValues() << endl;
121 S << "Function Description code : " << ent->FuncDescriptionCode() << endl;
122 S << "Function Description : ";
123 IGESData_DumpString(S,ent->FuncDescription());
124 S << endl;
125}