1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
20 //--------------------------------------------------------------------
21 //--------------------------------------------------------------------
23 #include <IGESAppli_ToolPWBArtworkStackup.ixx>
24 #include <IGESData_ParamCursor.hxx>
25 #include <TCollection_HAsciiString.hxx>
26 #include <TColStd_HArray1OfInteger.hxx>
27 #include <IGESData_Dump.hxx>
28 #include <Interface_Macros.hxx>
31 IGESAppli_ToolPWBArtworkStackup::IGESAppli_ToolPWBArtworkStackup () { }
34 void IGESAppli_ToolPWBArtworkStackup::ReadOwnParams
35 (const Handle(IGESAppli_PWBArtworkStackup)& ent,
36 const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
38 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
40 Standard_Integer tempNbPropertyValues;
41 Handle(TCollection_HAsciiString) tempArtworkStackupIdent;
42 Handle(TColStd_HArray1OfInteger) tempLevelNumbers;
43 //szv#4:S4163:12Mar99 `st=` not needed
44 PR.ReadInteger(PR.Current(), "Number of property values", tempNbPropertyValues);
45 PR.ReadText(PR.Current(), "Artwork Stackup Identification", tempArtworkStackupIdent);
46 if (!PR.ReadInteger(PR.Current(), "Number of level numbers", num)) num = 0;
47 if (num > 0) tempLevelNumbers = new TColStd_HArray1OfInteger(1, num);
48 else PR.AddFail("Number of level numbers: Not Positive");
49 if (!tempLevelNumbers.IsNull())
50 PR.ReadInts(PR.CurrentList(num), "Level Numbers", tempLevelNumbers);
52 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
53 ent->Init (tempNbPropertyValues, tempArtworkStackupIdent, tempLevelNumbers);
56 void IGESAppli_ToolPWBArtworkStackup::WriteOwnParams
57 (const Handle(IGESAppli_PWBArtworkStackup)& ent, IGESData_IGESWriter& IW) const
59 Standard_Integer i, num;
60 IW.Send(ent->NbPropertyValues());
61 IW.Send(ent->Identification());
62 IW.Send(ent->NbLevelNumbers());
63 for ( num = ent->NbLevelNumbers(), i = 1; i <= num; i++ )
64 IW.Send(ent->LevelNumber(i));
67 void IGESAppli_ToolPWBArtworkStackup::OwnShared
68 (const Handle(IGESAppli_PWBArtworkStackup)& /* ent */, Interface_EntityIterator& /* iter */) const
72 void IGESAppli_ToolPWBArtworkStackup::OwnCopy
73 (const Handle(IGESAppli_PWBArtworkStackup)& another,
74 const Handle(IGESAppli_PWBArtworkStackup)& ent, Interface_CopyTool& /* TC */) const
76 Standard_Integer num = another->NbLevelNumbers();
77 Standard_Integer tempNbPropertyValues = another->NbPropertyValues();
78 Handle(TCollection_HAsciiString) tempArtworkStackupIdent =
79 new TCollection_HAsciiString(another->Identification());
80 Handle(TColStd_HArray1OfInteger) tempLevelNumbers =
81 new TColStd_HArray1OfInteger(1, num);
82 for ( Standard_Integer i = 1; i <= num; i++ )
83 tempLevelNumbers->SetValue(i, another->LevelNumber(i));
84 ent->Init(tempNbPropertyValues, tempArtworkStackupIdent, tempLevelNumbers);
87 IGESData_DirChecker IGESAppli_ToolPWBArtworkStackup::DirChecker
88 (const Handle(IGESAppli_PWBArtworkStackup)& /* ent */ ) const
90 IGESData_DirChecker DC(406, 25);
91 DC.Structure(IGESData_DefVoid);
93 DC.LineFont(IGESData_DefVoid);
94 DC.LineWeight(IGESData_DefVoid);
95 DC.Color(IGESData_DefVoid);
96 DC.BlankStatusIgnored();
98 DC.HierarchyStatusIgnored();
102 void IGESAppli_ToolPWBArtworkStackup::OwnCheck
103 (const Handle(IGESAppli_PWBArtworkStackup)& /* ent */,
104 const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
108 void IGESAppli_ToolPWBArtworkStackup::OwnDump
109 (const Handle(IGESAppli_PWBArtworkStackup)& ent, const IGESData_IGESDumper& /* dumper */,
110 const Handle(Message_Messenger)& S, const Standard_Integer level) const
112 S << "IGESAppli_PWBArtworkStackup" << endl;
113 S << "Number of property values : " << ent->NbPropertyValues() << endl;
114 S << "Artwork Stackup Identification : ";
115 IGESData_DumpString(S,ent->Identification());
117 S << "Level Numbers : ";
118 IGESData_DumpVals(S ,level,1, ent->NbLevelNumbers(),ent->LevelNumber);