1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
19 #include <IGESAppli_FlowLineSpec.hxx>
20 #include <IGESAppli_ToolFlowLineSpec.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>
26 #include <IGESData_ParamCursor.hxx>
27 #include <IGESData_ParamReader.hxx>
28 #include <Interface_Check.hxx>
29 #include <Interface_CopyTool.hxx>
30 #include <Interface_EntityIterator.hxx>
31 #include <Interface_HArray1OfHAsciiString.hxx>
32 #include <Interface_Macros.hxx>
33 #include <Interface_ShareTool.hxx>
34 #include <Message_Messenger.hxx>
35 #include <Standard_DomainError.hxx>
36 #include <TCollection_HAsciiString.hxx>
38 IGESAppli_ToolFlowLineSpec::IGESAppli_ToolFlowLineSpec () { }
41 void IGESAppli_ToolFlowLineSpec::ReadOwnParams
42 (const Handle(IGESAppli_FlowLineSpec)& ent,
43 const Handle(IGESData_IGESReaderData)& /* IR */, IGESData_ParamReader& PR) const
45 //Standard_Boolean st; //szv#4:S4163:12Mar99 not needed
47 Handle(Interface_HArray1OfHAsciiString) tempNameAndModifiers;
48 if (!PR.ReadInteger(PR.Current(), "Number of property values", num)) num = 0;
49 if (num > 0) tempNameAndModifiers = new Interface_HArray1OfHAsciiString(1, num);
50 else PR.AddFail("Number of property values: Not Positive");
51 //szv#4:S4163:12Mar99 `st=` not needed
52 if (!tempNameAndModifiers.IsNull())
53 PR.ReadTexts(PR.CurrentList(num), "Name and Modifiers", tempNameAndModifiers);
55 DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
56 ent->Init(tempNameAndModifiers);
59 void IGESAppli_ToolFlowLineSpec::WriteOwnParams
60 (const Handle(IGESAppli_FlowLineSpec)& ent, IGESData_IGESWriter& IW) const
62 Standard_Integer i, num;
63 IW.Send(ent->NbPropertyValues());
64 for ( num = ent->NbPropertyValues(), i = 1; i <= num; i++ )
65 IW.Send(ent->Modifier(i));
68 void IGESAppli_ToolFlowLineSpec::OwnShared
69 (const Handle(IGESAppli_FlowLineSpec)& /* ent */, Interface_EntityIterator& /* iter */) const
73 void IGESAppli_ToolFlowLineSpec::OwnCopy
74 (const Handle(IGESAppli_FlowLineSpec)& another,
75 const Handle(IGESAppli_FlowLineSpec)& ent, Interface_CopyTool& /* TC */) const
77 Standard_Integer num = another->NbPropertyValues();
78 Handle(Interface_HArray1OfHAsciiString) tempNameAndModifiers =
79 new Interface_HArray1OfHAsciiString(1, num);
80 for ( Standard_Integer i = 1; i <= num; i++ )
81 tempNameAndModifiers->SetValue
82 (i, new TCollection_HAsciiString(another->Modifier(i)));
83 ent->Init(tempNameAndModifiers);
86 IGESData_DirChecker IGESAppli_ToolFlowLineSpec::DirChecker
87 (const Handle(IGESAppli_FlowLineSpec)& /* ent */ ) const
89 IGESData_DirChecker DC(406, 14);
90 DC.Structure(IGESData_DefVoid);
92 DC.LineFont(IGESData_DefVoid);
93 DC.LineWeight(IGESData_DefVoid);
94 DC.Color(IGESData_DefVoid);
95 DC.BlankStatusIgnored();
97 DC.HierarchyStatusIgnored();
101 void IGESAppli_ToolFlowLineSpec::OwnCheck
102 (const Handle(IGESAppli_FlowLineSpec)& /* ent */,
103 const Interface_ShareTool& , Handle(Interface_Check)& /* ach */) const
107 void IGESAppli_ToolFlowLineSpec::OwnDump
108 (const Handle(IGESAppli_FlowLineSpec)& ent, const IGESData_IGESDumper& /* dumper */,
109 Standard_OStream& S, const Standard_Integer level) const
111 S << "IGESAppli_FlowLineSpec\n";
112 S << "Name and Modifiers : ";
113 IGESData_DumpStrings(S ,level,1, ent->NbPropertyValues(),ent->Modifier);