0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / IGESAppli / IGESAppli_ToolPWBArtworkStackup.cxx
CommitLineData
b311480e 1// Created by: CKY / Contract Toubro-Larsen
2// Copyright (c) 1993-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
7fd59977 6//
d5f74e42 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
973c2be1 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.
7fd59977 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
16//--------------------------------------------------------------------
7fd59977 17//--------------------------------------------------------------------
18
42cf5bc1 19#include <IGESAppli_PWBArtworkStackup.hxx>
20#include <IGESAppli_ToolPWBArtworkStackup.hxx>
21#include <IGESData_DirChecker.hxx>
22#include <IGESData_Dump.hxx>
23#include <IGESData_IGESDumper.hxx>
24#include <IGESData_IGESReaderData.hxx>
25#include <IGESData_IGESWriter.hxx>
7fd59977 26#include <IGESData_ParamCursor.hxx>
42cf5bc1 27#include <IGESData_ParamReader.hxx>
28#include <Interface_Check.hxx>
29#include <Interface_CopyTool.hxx>
30#include <Interface_EntityIterator.hxx>
31#include <Interface_Macros.hxx>
32#include <Interface_ShareTool.hxx>
33#include <Message_Messenger.hxx>
34#include <Standard_DomainError.hxx>
7fd59977 35#include <TCollection_HAsciiString.hxx>
36#include <TColStd_HArray1OfInteger.hxx>
7fd59977 37
38IGESAppli_ToolPWBArtworkStackup::IGESAppli_ToolPWBArtworkStackup () { }
39
40
41void IGESAppli_ToolPWBArtworkStackup::ReadOwnParams
42 (const Handle(IGESAppli_PWBArtworkStackup)& ent,
43 const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
44{
45 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
46 Standard_Integer num;
47 Standard_Integer tempNbPropertyValues;
48 Handle(TCollection_HAsciiString) tempArtworkStackupIdent;
49 Handle(TColStd_HArray1OfInteger) tempLevelNumbers;
50 //szv#4:S4163:12Mar99 `st=` not needed
51 PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropertyValues);
52 PR.ReadText(PR.Current(), "Artwork Stackup Identification", tempArtworkStackupIdent);
53 if (!PR.ReadInteger(PR.Current(), "Number of level numbers", num)) num = 0;
54 if (num > 0) tempLevelNumbers = new TColStd_HArray1OfInteger(1, num);
55 else PR.AddFail("Number of level numbers: Not Positive");
56 if (!tempLevelNumbers.IsNull())
57 PR.ReadInts(PR.CurrentList(num), "Level Numbers", tempLevelNumbers);
58
59 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
60 ent->Init (tempNbPropertyValues, tempArtworkStackupIdent, tempLevelNumbers);
61}
62
63void IGESAppli_ToolPWBArtworkStackup::WriteOwnParams
64 (const Handle(IGESAppli_PWBArtworkStackup)& ent, IGESData_IGESWriter& IW) const
65{
66 Standard_Integer i, num;
67 IW.Send(ent->NbPropertyValues());
68 IW.Send(ent->Identification());
69 IW.Send(ent->NbLevelNumbers());
70 for ( num = ent->NbLevelNumbers(), i = 1; i <= num; i++ )
71 IW.Send(ent->LevelNumber(i));
72}
73
74void IGESAppli_ToolPWBArtworkStackup::OwnShared
75 (const Handle(IGESAppli_PWBArtworkStackup)& /* ent */, Interface_EntityIterator& /* iter */) const
76{
77}
78
79void IGESAppli_ToolPWBArtworkStackup::OwnCopy
80 (const Handle(IGESAppli_PWBArtworkStackup)& another,
81 const Handle(IGESAppli_PWBArtworkStackup)& ent, Interface_CopyTool& /* TC */) const
82{
83 Standard_Integer num = another->NbLevelNumbers();
84 Standard_Integer tempNbPropertyValues = another->NbPropertyValues();
85 Handle(TCollection_HAsciiString) tempArtworkStackupIdent =
86 new TCollection_HAsciiString(another->Identification());
87 Handle(TColStd_HArray1OfInteger) tempLevelNumbers =
88 new TColStd_HArray1OfInteger(1, num);
89 for ( Standard_Integer i = 1; i <= num; i++ )
90 tempLevelNumbers->SetValue(i, another->LevelNumber(i));
91 ent->Init(tempNbPropertyValues, tempArtworkStackupIdent, tempLevelNumbers);
92}
93
94IGESData_DirChecker IGESAppli_ToolPWBArtworkStackup::DirChecker
95 (const Handle(IGESAppli_PWBArtworkStackup)& /* ent */ ) const
96{
97 IGESData_DirChecker DC(406, 25);
98 DC.Structure(IGESData_DefVoid);
99 DC.GraphicsIgnored();
100 DC.LineFont(IGESData_DefVoid);
101 DC.LineWeight(IGESData_DefVoid);
102 DC.Color(IGESData_DefVoid);
103 DC.BlankStatusIgnored();
104 DC.UseFlagIgnored();
105 DC.HierarchyStatusIgnored();
106 return DC;
107}
108
109void IGESAppli_ToolPWBArtworkStackup::OwnCheck
110 (const Handle(IGESAppli_PWBArtworkStackup)& /* ent */,
111 const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
112{
113}
114
115void IGESAppli_ToolPWBArtworkStackup::OwnDump
116 (const Handle(IGESAppli_PWBArtworkStackup)& ent, const IGESData_IGESDumper& /* dumper */,
117 const Handle(Message_Messenger)& S, const Standard_Integer level) const
118{
119 S << "IGESAppli_PWBArtworkStackup" << endl;
120 S << "Number of property values : " << ent->NbPropertyValues() << endl;
121 S << "Artwork Stackup Identification : ";
122 IGESData_DumpString(S,ent->Identification());
123 S << endl;
124 S << "Level Numbers : ";
125 IGESData_DumpVals(S ,level,1, ent->NbLevelNumbers(),ent->LevelNumber);
126 S << endl;
127}